Skip to content

Discord Relay

aquafir edited this page Oct 10, 2022 · 4 revisions

Installation

  • 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();
    

Your Bot

  • 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
  • Go to the OAuth2 tab.
    • Under Scopes check bot and copy the URL
    • Under Permissions add what's needed or go with Administrator for testing
  • Go to the copied URL to add the bot to your Discord channel

Channel ID

  • Make sure you've in developer mode in Discord under Settings->Advanced
  • Right-click the desired channel and Copy ID
Clone this wiki locally