From 349da37386212f2236adcb8b3cf5e209f47544d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Horonziak?= Date: Sun, 19 Apr 2020 11:11:41 +0200 Subject: [PATCH] Refactor --- discord.go | 2 +- structs.go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/discord.go b/discord.go index 1944c15..789ca68 100644 --- a/discord.go +++ b/discord.go @@ -74,7 +74,7 @@ func New(args ...interface{}) (s *Session, err error) { s.Identify.GuildSubscriptions = true s.Identify.Properties.OS = runtime.GOOS s.Identify.Properties.Browser = "DiscordGo v" + VERSION - s.Identify.Intents = 32767 + s.Identify.Intents = IntentsAllWithoutPrivileged // If no arguments are passed return the empty Session interface. if args == nil { diff --git a/structs.go b/structs.go index 43b39b5..944f899 100644 --- a/structs.go +++ b/structs.go @@ -1103,3 +1103,38 @@ const ( ErrCodeReactionBlocked = 90001 ) + +const ( + IntentsGuilds = 1 << iota + IntentsGuildMembers + IntentsGuildBans + IntentsGuildEmojis + IntentsGuildIntegrations + IntentsGuildWebhooks + IntentsGuildInvites + IntentsGuildVoiceStates + IntentsGuildPresences + IntentsGuildMessages + IntentsGuildMessageReactions + IntentsGuildMessageTyping + IntentsDirectMessagesMessages + IntentsDirectMessageReaction + IntentsDirectMessageTyping + + IntentsAllWithoutPrivileged = IntentsGuilds | + IntentsGuildBans | + IntentsGuildEmojis | + IntentsGuildIntegrations | + IntentsGuildWebhooks | + IntentsGuildInvites | + IntentsGuildVoiceStates | + IntentsGuildMessages | + IntentsGuildMessageReactions | + IntentsGuildMessageTyping | + IntentsDirectMessagesMessages | + IntentsDirectMessageReaction | + IntentsDirectMessageTyping + IntentsAll = IntentsAllWithoutPrivileged | + IntentsGuildMembers | + IntentsGuildPresences +)