@@ -959,6 +959,7 @@ type Identify struct {
959
959
Shard * [2 ]int `json:"shard,omitempty"`
960
960
Presence GatewayStatusUpdate `json:"presence,omitempty"`
961
961
GuildSubscriptions bool `json:"guild_subscriptions"`
962
+ Intents * Intent `json:"intents,omitempty"`
962
963
}
963
964
964
965
// IdentifyProperties contains the "properties" portion of an Identify packet
@@ -1102,3 +1103,49 @@ const (
1102
1103
1103
1104
ErrCodeReactionBlocked = 90001
1104
1105
)
1106
+
1107
+ // Intent is the type of a Gateway Intent
1108
+ // https://discord.com/developers/docs/topics/gateway#gateway-intents
1109
+ type Intent int
1110
+
1111
+ // Constants for the different bit offsets of intents
1112
+ const (
1113
+ IntentsGuilds Intent = 1 << iota
1114
+ IntentsGuildMembers
1115
+ IntentsGuildBans
1116
+ IntentsGuildEmojis
1117
+ IntentsGuildIntegrations
1118
+ IntentsGuildWebhooks
1119
+ IntentsGuildInvites
1120
+ IntentsGuildVoiceStates
1121
+ IntentsGuildPresences
1122
+ IntentsGuildMessages
1123
+ IntentsGuildMessageReactions
1124
+ IntentsGuildMessageTyping
1125
+ IntentsDirectMessages
1126
+ IntentsDirectMessageReactions
1127
+ IntentsDirectMessageTyping
1128
+
1129
+ IntentsAllWithoutPrivileged = IntentsGuilds |
1130
+ IntentsGuildBans |
1131
+ IntentsGuildEmojis |
1132
+ IntentsGuildIntegrations |
1133
+ IntentsGuildWebhooks |
1134
+ IntentsGuildInvites |
1135
+ IntentsGuildVoiceStates |
1136
+ IntentsGuildMessages |
1137
+ IntentsGuildMessageReactions |
1138
+ IntentsGuildMessageTyping |
1139
+ IntentsDirectMessages |
1140
+ IntentsDirectMessageReactions |
1141
+ IntentsDirectMessageTyping
1142
+ IntentsAll = IntentsAllWithoutPrivileged |
1143
+ IntentsGuildMembers |
1144
+ IntentsGuildPresences
1145
+ IntentsNone Intent = 0
1146
+ )
1147
+
1148
+ // MakeIntent helps convert a gateway intent value for use in the Identify structure.
1149
+ func MakeIntent (intents Intent ) * Intent {
1150
+ return & intents
1151
+ }
0 commit comments