From de7803becd8a2b4230f8e0bca74f8f6d14acbba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Horonziak?= Date: Sun, 24 May 2020 08:34:29 +0200 Subject: [PATCH] Refactor --- discord.go | 1 + structs.go | 2 +- util.go | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/discord.go b/discord.go index 74c7887..1f5f5a0 100644 --- a/discord.go +++ b/discord.go @@ -74,6 +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 = MakeIntent(IntentsAllWithoutPrivileged) // If no arguments are passed return the empty Session interface. if args == nil { diff --git a/structs.go b/structs.go index b706c18..914bd4e 100644 --- a/structs.go +++ b/structs.go @@ -1139,5 +1139,5 @@ const ( IntentsAll = IntentsAllWithoutPrivileged | IntentsGuildMembers | IntentsGuildPresences - IntentsNone Intent = 0 + IntentsNone Intent = 0 ) diff --git a/util.go b/util.go index 02443ca..1dc3f47 100644 --- a/util.go +++ b/util.go @@ -15,3 +15,7 @@ func SnowflakeTimestamp(ID string) (t time.Time, err error) { t = time.Unix(timestamp/1000, 0) return } + +func MakeIntent(intents Intent) *Intent { + return &intents +}