forked from ACEmulator/ACE
-
Notifications
You must be signed in to change notification settings - Fork 1
Discord Relay
aquafir edited this page Oct 10, 2022
·
4 revisions
-
Add Discord.Net from Nuget to
ACE.Server
.- Unfortunately adding this requires you to make some changes to ACE due to a conflict between EF Core and async LINQ.
- To fix, do a Find-Replace with Regex in
ACE.Server
for these:-
(= from.+$)
...with:$1.AsQueryable()
-
\.(Where|OrderBy|ContainsKey)
...with:.AsQueryable().$1
-
-
Add the file with the DiscordRelay to ACE
- Set the RELAY_CHANNEL_ID to the channel ID used to mirror messages
- Set other options if you'd like.
-
Create a bot as described below.
- Add it to your channel.
- Supply the credentials you get from it in
DiscordRelay
.
-
Add this to the constructor of
GameMessageTurbineChat
:ACE.Server.ACX.Discord.DiscordRelay.RelayIngameChat(message, senderName, chatType, channel, senderID, chatNetworkBlobType, chatNetworkBlobDispatchType);
-
Add this to
Program
:log.Info("Initializing Discord Relay..."); ACX.Discord.DiscordRelay.Initialize();
- Create (and customize if you want) an application at the Developers Portal
- Add a bot to the application under the
Bot
tab- Copy the
Token
to log in with the bot
- Copy the
- Go to the
OAuth2
tab.- Under
Scopes
checkbot
and copy the URL - Under
Permissions
add what's needed or go withAdministrator
for testing
- Under
- Go to the copied URL to add the bot to your Discord channel
- Make sure you've in developer mode in Discord under
Settings
->Advanced
-
Right-click
the desired channel andCopy ID