[DOC] How to Create / Setup a Discord bot with RAT

TOP-ic

New member
Jan 20, 2017
17
2
3
46
Russia
I was able to add the bot only on this link:
Code:
https://discordapp.com/oauth2/authorize?&client_id=CLIENT_ID&scope=bot&permissions=0
 
I just set it up on my server/channel and it works. Very nice!

Is it correkt that it is only a one-way link from game to Discord? Or can people from Disord somehow talk back into the game? Maybe even issue commands? If so, how?
 
I just set it up on my server/channel and it works. Very nice!

Is it correkt that it is only a one-way link from game to Discord? Or can people from Disord somehow talk back into the game? Maybe even issue commands? If so, how?

Sure, you can reply, you'll need to add a new event for something like !SAY
Conditional: STARTSWITH:!say||CHECKDISCORDROLE:>=Discord Admins
Script: say "[{player_name}]: {0}"

Change the "Discord Admins" to a roll in Discord that you want to be able to use the chat command. Note that I think there is an issue using the default roles, so make a new one and set it to that. I'll work on that bug later.
 
Good day! I understand that the above asked about feedback discord-->server.
I have configured the server --> discord and works great. But how to do to be able to write in discorde and displayed on the server, I don't understand. Prompt, please, in more detail. Thank you.
 
Good day! I understand that the above asked about feedback discord-->server.
I have configured the server --> discord and works great. But how to do to be able to write in discorde and displayed on the server, I don't understand. Prompt, please, in more detail. Thank you.

I'm a bit unclear as you said you have it working from Server -> Discord, but that you want to write in Discord and show it on the server? That appears to be the same thing? The above response to djkrose does exactly that?

But to try and make that example more clear.

Create a new event, and set it with these parameters.

Type: Player Public Chat
Conditional: STARTSWITH:!say||CHECKDISCORDROLE:>=Discord Admins
Script: say "[{player_name}]: {0}"

Then, when you want to say something on the server, from discord, type:!say This is going to appear in the 7D2D game chat.

If you want your game chat to be displayed in Discord. Then edit the last event for Player Public Chat, it has an order of 9999 on it.

Add to the Script: .DSAY:<{player_name}> {player_chat}

That will display any chat the players type in the game, in Discord.

Those two options will cover both Game Server -> Discord and Discord -> Game Server.
 
  • Like
Reactions: TOP-ic
Sorry if not clear . Still the Google translator. )))
1. Established in the RAT that you wrote.
1.jpg
2. Write text in the programm Discord
2.jpg
3. The message appears in the tab Discord
3.jpg
4. But the chat is empty. (((
4.jpg

I missed something?

And again. I have duplicated messages. )))
5.jpg
 
Last edited:
In Step 1, you have defined the command that RAT will listen for as !say

You also need to make sure that you either change the Discord role: Discord Admins, to a role that exists on your Discord server, or create that role and assign it to anyone you want to be able to chat in from Discord, into the 7D2D game.

So, if you want something in Discord to appear in the game chat, you need to prefix what you say with !say.

Example:

!say this is a test
!say Hello from Discord!
 
  • Like
Reactions: TOP-ic
Strange, but the connection is discord -> the server stopped working. In the settings did nothing. Two days worked, then stopped.
 
Strange, but the connection is discord -> the server stopped working. In the settings did nothing. Two days worked, then stopped.

I've had one other report of this, I was told that rebooting was the only thing that allowed the connection to work again. If you can, please try that and let me know. It'll give me more information to work with when troubleshooting the issue.
 
Unfortunately restarting the RAT, server, and discord did not fix the situation. The report does not come with discord to the server.
 
I meant reboot the machine that RAT is running on. It shouldn't matter, but I'm told that fixed it for someone. So that's what I'm trying to test sinec I haven't encountered the issue.
 
I'm able to reproduce many issues with this. It looks like the Discord service upgrade caused some issues with backward compatibility... so I need to dig into this a lot more. Basically, don't bother trying at the moment, its broken. I'll update as soon as I have something new.
 
  • Like
Reactions: TOP-ic