Skip to content

Commit

Permalink
TwitchChatVotingProxy: Remove redundant GatewayIntents from discord c…
Browse files Browse the repository at this point in the history
…lient & add clarification
  • Loading branch information
pongo1231 committed Aug 27, 2023
1 parent 878677d commit 406031f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions TwitchChatVotingProxy/VotingReceiver/DiscordVotingReceiver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ namespace TwitchChatVotingProxy.VotingReceiver
/// </summary>
class DiscordVotingReceiver : IVotingReceiver
{
public static readonly int RECONNECT_INTERVAL = 1000;

public event EventHandler<OnMessageArgs> OnMessage;

private string m_BotToken;
Expand Down Expand Up @@ -45,7 +43,13 @@ public async Task<bool> Init()
return false;
}

m_Client = new DiscordSocketClient();
m_Client = new DiscordSocketClient(new DiscordSocketConfig()
{
// We don't actually need any but the Ready event fires much later without this for whatever reason
// So we just enable all unprivileged intents minus the ones the log warns us against using
GatewayIntents = GatewayIntents.AllUnprivileged
& ~(GatewayIntents.GuildScheduledEvents | GatewayIntents.GuildInvites)
});

m_Client.Log += OnLog;
m_Client.Ready += OnReady;
Expand Down

0 comments on commit 406031f

Please sign in to comment.