A bot and server plugin to allow server logs to be sent to Discord channels, and for server commands to be run via the Discord bot.
EXILED 6.0.0++
- Extract
DiscordIntegration.dll
and its dependencies fromPlugin.tar.gz
. - Place
DiscordIntegration.dll
inside the EXILEDPlugins
folder like any other plugin and its dependencies in thePlugins/dependencies
folder. - Download the
DiscordIntegration.Bot
(Linux) orDiscordIntegration.Bot.exe
(Windows) file, and place it anywhere within the system running the SL server.
- Go to https://discord.com/developers/applications and create a new application.
- Inside of the application page under "settings" click Bot & build the bot.
- After creating the bot you can change the bots username and avatar if you wish.
Bot token is located on the Bot page under username, Do NOT share the token because people can control the bot if they get it.
- Go to "OAuth2" tab of the bot application on the above link.
- Click the boxes labled "bot" and "application.commands".
- Give the bot appropriate permissions (this is usually either Admin, or at the very least Send Messages).
- Copy & paste the oauth2 URL link provided at the bottom of the page into a browser window.
- The new page will ask you which server to invite the bot to, and once you select the correct server, click Authorize.
Note that before generating the link, check that you have applications.commands scope.
Open the bot once to let it automatically generate config.json file. Remember to always wrap configs with quotation marks, even if it's not necessary for strings.
Fill out the bot's config for the bot token, discord server id, and channel IDs, then start the bot.
- Double-click the .exe file.
- Run
cd path/to/bot
replacingpath/to/bot
with the path of where the extracted bot is located. - Run
./DiscordIntegration.Bot
.
-
Open your bot
config.json
file. -
Add role IDs and list every command they can execute. You can use
.*
to permit to that role ID to use all game commands without restrictions.
"ValidCommands": {
"1": {
"953784342595915779": [
"di"
]
}
},
- Never duplicate commands. Higher roles on your Discord server will be able to use lower roles commands as well, based on the position of the roles.
Command | Description | Arguments | Permission | Example |
---|---|---|---|---|
di playerlist | Gets the list of players in the server. | di.playerlist | di playerlist | |
di stafflist | Gets the list of staffers in the server. | di.stafflist | di stafflist |