dfx 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/dist/Cache/driver.d.ts.map +1 -1
  2. package/dist/Cache/memory.d.ts.map +1 -1
  3. package/dist/Cache/memoryTTL.d.ts.map +1 -1
  4. package/dist/Cache/prelude.d.ts.map +1 -1
  5. package/dist/Cache.d.ts.map +1 -1
  6. package/dist/DiscordConfig.d.ts.map +1 -1
  7. package/dist/DiscordGateway/DiscordWS.d.ts.map +1 -1
  8. package/dist/DiscordGateway/Messaging.d.ts.map +1 -1
  9. package/dist/DiscordGateway/Shard/StateStore.d.ts.map +1 -1
  10. package/dist/DiscordGateway/Shard/heartbeats.d.ts.map +1 -1
  11. package/dist/DiscordGateway/Shard/identify.d.ts.map +1 -1
  12. package/dist/DiscordGateway/Shard/sendEvents.d.ts.map +1 -1
  13. package/dist/DiscordGateway/Shard/utils.d.ts.map +1 -1
  14. package/dist/DiscordGateway/Shard.d.ts.map +1 -1
  15. package/dist/DiscordGateway/ShardStore.d.ts.map +1 -1
  16. package/dist/DiscordGateway/Sharder.d.ts +1 -1
  17. package/dist/DiscordGateway/Sharder.d.ts.map +1 -1
  18. package/dist/DiscordGateway.d.ts.map +1 -1
  19. package/dist/DiscordREST/Generated.d.ts.map +1 -1
  20. package/dist/DiscordREST/utils.d.ts.map +1 -1
  21. package/dist/DiscordREST.d.ts.map +1 -1
  22. package/dist/Helpers/flags.d.ts.map +1 -1
  23. package/dist/Helpers/intents.d.ts.map +1 -1
  24. package/dist/Helpers/interactions.d.ts.map +1 -1
  25. package/dist/Helpers/members.d.ts.map +1 -1
  26. package/dist/Helpers/permissions.d.ts.map +1 -1
  27. package/dist/Helpers/ui.d.ts.map +1 -1
  28. package/dist/Interactions/builder.d.ts.map +1 -1
  29. package/dist/Interactions/commandHelper.d.ts.map +1 -1
  30. package/dist/Interactions/context.d.ts.map +1 -1
  31. package/dist/Interactions/definitions.d.ts.map +1 -1
  32. package/dist/Interactions/error.d.ts.map +1 -1
  33. package/dist/Interactions/gateway.d.ts.map +1 -1
  34. package/dist/Interactions/handlers.d.ts.map +1 -1
  35. package/dist/Interactions/index.d.ts.map +1 -1
  36. package/dist/Interactions/utils.d.ts.map +1 -1
  37. package/dist/Interactions/webhook.d.ts.map +1 -1
  38. package/dist/RateLimit/memory.d.ts.map +1 -1
  39. package/dist/RateLimit/utils.d.ts.map +1 -1
  40. package/dist/RateLimit.d.ts.map +1 -1
  41. package/dist/gateway.d.ts.map +1 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/types.d.ts.map +1 -1
  44. package/dist/utils/Effect.d.ts.map +1 -1
  45. package/dist/version.d.ts +1 -1
  46. package/dist/version.d.ts.map +1 -1
  47. package/dist/version.js +1 -1
  48. package/dist/webhooks.d.ts.map +1 -1
  49. package/package.json +5 -5
  50. package/src/version.ts +1 -1
  51. package/dist/LICENSE +0 -21
  52. package/dist/README.md +0 -66
  53. package/dist/mjs/Cache/driver.mjs +0 -3
  54. package/dist/mjs/Cache/driver.mjs.map +0 -1
  55. package/dist/mjs/Cache/memory.mjs +0 -48
  56. package/dist/mjs/Cache/memory.mjs.map +0 -1
  57. package/dist/mjs/Cache/memoryTTL.mjs +0 -119
  58. package/dist/mjs/Cache/memoryTTL.mjs.map +0 -1
  59. package/dist/mjs/Cache/prelude.mjs +0 -131
  60. package/dist/mjs/Cache/prelude.mjs.map +0 -1
  61. package/dist/mjs/Cache.mjs +0 -90
  62. package/dist/mjs/Cache.mjs.map +0 -1
  63. package/dist/mjs/DiscordConfig.mjs +0 -32
  64. package/dist/mjs/DiscordConfig.mjs.map +0 -1
  65. package/dist/mjs/DiscordGateway/DiscordWS.mjs +0 -77
  66. package/dist/mjs/DiscordGateway/DiscordWS.mjs.map +0 -1
  67. package/dist/mjs/DiscordGateway/Messaging.mjs +0 -35
  68. package/dist/mjs/DiscordGateway/Messaging.mjs.map +0 -1
  69. package/dist/mjs/DiscordGateway/Shard/StateStore.mjs +0 -41
  70. package/dist/mjs/DiscordGateway/Shard/StateStore.mjs.map +0 -1
  71. package/dist/mjs/DiscordGateway/Shard/heartbeats.mjs +0 -25
  72. package/dist/mjs/DiscordGateway/Shard/heartbeats.mjs.map +0 -1
  73. package/dist/mjs/DiscordGateway/Shard/identify.mjs +0 -29
  74. package/dist/mjs/DiscordGateway/Shard/identify.mjs.map +0 -1
  75. package/dist/mjs/DiscordGateway/Shard/sendEvents.mjs +0 -26
  76. package/dist/mjs/DiscordGateway/Shard/sendEvents.mjs.map +0 -1
  77. package/dist/mjs/DiscordGateway/Shard/utils.mjs +0 -3
  78. package/dist/mjs/DiscordGateway/Shard/utils.mjs.map +0 -1
  79. package/dist/mjs/DiscordGateway/Shard.mjs +0 -147
  80. package/dist/mjs/DiscordGateway/Shard.mjs.map +0 -1
  81. package/dist/mjs/DiscordGateway/ShardStore.mjs +0 -24
  82. package/dist/mjs/DiscordGateway/ShardStore.mjs.map +0 -1
  83. package/dist/mjs/DiscordGateway/Sharder.mjs +0 -67
  84. package/dist/mjs/DiscordGateway/Sharder.mjs.map +0 -1
  85. package/dist/mjs/DiscordGateway.mjs +0 -21
  86. package/dist/mjs/DiscordGateway.mjs.map +0 -1
  87. package/dist/mjs/DiscordREST/Generated.mjs +0 -2471
  88. package/dist/mjs/DiscordREST/Generated.mjs.map +0 -1
  89. package/dist/mjs/DiscordREST/utils.mjs +0 -21
  90. package/dist/mjs/DiscordREST/utils.mjs.map +0 -1
  91. package/dist/mjs/DiscordREST.mjs +0 -119
  92. package/dist/mjs/DiscordREST.mjs.map +0 -1
  93. package/dist/mjs/Helpers/flags.mjs +0 -45
  94. package/dist/mjs/Helpers/flags.mjs.map +0 -1
  95. package/dist/mjs/Helpers/intents.mjs +0 -27
  96. package/dist/mjs/Helpers/intents.mjs.map +0 -1
  97. package/dist/mjs/Helpers/interactions.mjs +0 -115
  98. package/dist/mjs/Helpers/interactions.mjs.map +0 -1
  99. package/dist/mjs/Helpers/members.mjs +0 -9
  100. package/dist/mjs/Helpers/members.mjs.map +0 -1
  101. package/dist/mjs/Helpers/permissions.mjs +0 -84
  102. package/dist/mjs/Helpers/permissions.mjs.map +0 -1
  103. package/dist/mjs/Helpers/ui.mjs +0 -137
  104. package/dist/mjs/Helpers/ui.mjs.map +0 -1
  105. package/dist/mjs/Interactions/builder.mjs +0 -56
  106. package/dist/mjs/Interactions/builder.mjs.map +0 -1
  107. package/dist/mjs/Interactions/commandHelper.mjs +0 -49
  108. package/dist/mjs/Interactions/commandHelper.mjs.map +0 -1
  109. package/dist/mjs/Interactions/context.mjs +0 -28
  110. package/dist/mjs/Interactions/context.mjs.map +0 -1
  111. package/dist/mjs/Interactions/definitions.mjs +0 -51
  112. package/dist/mjs/Interactions/definitions.mjs.map +0 -1
  113. package/dist/mjs/Interactions/error.mjs +0 -2
  114. package/dist/mjs/Interactions/error.mjs.map +0 -1
  115. package/dist/mjs/Interactions/gateway.mjs +0 -82
  116. package/dist/mjs/Interactions/gateway.mjs.map +0 -1
  117. package/dist/mjs/Interactions/handlers.mjs +0 -64
  118. package/dist/mjs/Interactions/handlers.mjs.map +0 -1
  119. package/dist/mjs/Interactions/index.mjs +0 -11
  120. package/dist/mjs/Interactions/index.mjs.map +0 -1
  121. package/dist/mjs/Interactions/utils.mjs +0 -26
  122. package/dist/mjs/Interactions/utils.mjs.map +0 -1
  123. package/dist/mjs/Interactions/webhook.mjs +0 -75
  124. package/dist/mjs/Interactions/webhook.mjs.map +0 -1
  125. package/dist/mjs/RateLimit/memory.mjs +0 -39
  126. package/dist/mjs/RateLimit/memory.mjs.map +0 -1
  127. package/dist/mjs/RateLimit/utils.mjs +0 -18
  128. package/dist/mjs/RateLimit/utils.mjs.map +0 -1
  129. package/dist/mjs/RateLimit.mjs +0 -28
  130. package/dist/mjs/RateLimit.mjs.map +0 -1
  131. package/dist/mjs/gateway.mjs +0 -19
  132. package/dist/mjs/gateway.mjs.map +0 -1
  133. package/dist/mjs/index.mjs +0 -18
  134. package/dist/mjs/index.mjs.map +0 -1
  135. package/dist/mjs/types.mjs +0 -356
  136. package/dist/mjs/types.mjs.map +0 -1
  137. package/dist/mjs/utils/Effect.mjs +0 -44
  138. package/dist/mjs/utils/Effect.mjs.map +0 -1
  139. package/dist/mjs/version.mjs +0 -2
  140. package/dist/mjs/version.mjs.map +0 -1
  141. package/dist/mjs/webhooks.mjs +0 -6
  142. package/dist/mjs/webhooks.mjs.map +0 -1
  143. package/dist/package.json +0 -48
  144. package/dist/src/Cache/driver.ts +0 -37
  145. package/dist/src/Cache/memory.ts +0 -83
  146. package/dist/src/Cache/memoryTTL.ts +0 -225
  147. package/dist/src/Cache/prelude.ts +0 -279
  148. package/dist/src/Cache.ts +0 -261
  149. package/dist/src/DiscordConfig.ts +0 -67
  150. package/dist/src/DiscordGateway/DiscordWS.ts +0 -157
  151. package/dist/src/DiscordGateway/Messaging.ts +0 -71
  152. package/dist/src/DiscordGateway/Shard/StateStore.ts +0 -72
  153. package/dist/src/DiscordGateway/Shard/heartbeats.ts +0 -60
  154. package/dist/src/DiscordGateway/Shard/identify.ts +0 -50
  155. package/dist/src/DiscordGateway/Shard/sendEvents.ts +0 -43
  156. package/dist/src/DiscordGateway/Shard/utils.ts +0 -13
  157. package/dist/src/DiscordGateway/Shard.ts +0 -205
  158. package/dist/src/DiscordGateway/ShardStore.ts +0 -42
  159. package/dist/src/DiscordGateway/Sharder.ts +0 -118
  160. package/dist/src/DiscordGateway.ts +0 -79
  161. package/dist/src/DiscordREST/Generated.ts +0 -10832
  162. package/dist/src/DiscordREST/utils.ts +0 -42
  163. package/dist/src/DiscordREST.ts +0 -256
  164. package/dist/src/Helpers/flags.ts +0 -73
  165. package/dist/src/Helpers/intents.ts +0 -35
  166. package/dist/src/Helpers/interactions.ts +0 -317
  167. package/dist/src/Helpers/members.ts +0 -18
  168. package/dist/src/Helpers/permissions.ts +0 -145
  169. package/dist/src/Helpers/ui.ts +0 -253
  170. package/dist/src/Interactions/builder.ts +0 -171
  171. package/dist/src/Interactions/commandHelper.ts +0 -231
  172. package/dist/src/Interactions/context.ts +0 -104
  173. package/dist/src/Interactions/definitions.ts +0 -144
  174. package/dist/src/Interactions/error.ts +0 -3
  175. package/dist/src/Interactions/gateway.ts +0 -193
  176. package/dist/src/Interactions/handlers.ts +0 -108
  177. package/dist/src/Interactions/index.ts +0 -30
  178. package/dist/src/Interactions/utils.ts +0 -93
  179. package/dist/src/Interactions/webhook.ts +0 -204
  180. package/dist/src/RateLimit/memory.ts +0 -63
  181. package/dist/src/RateLimit/utils.ts +0 -28
  182. package/dist/src/RateLimit.ts +0 -90
  183. package/dist/src/gateway.ts +0 -50
  184. package/dist/src/index.ts +0 -44
  185. package/dist/src/types.ts +0 -3090
  186. package/dist/src/utils/Effect.ts +0 -65
  187. package/dist/src/version.ts +0 -1
  188. package/dist/src/webhooks.ts +0 -25
  189. package/dist/tsconfig.base.json +0 -54
  190. package/dist/tsconfig.build.json +0 -10
  191. package/dist/tsconfig.examples.json +0 -10
  192. package/dist/tsconfig.json +0 -14
  193. package/dist/tsconfig.madge.json +0 -12
  194. package/dist/tsconfig.test.json +0 -10
package/dist/src/types.ts DELETED
@@ -1,3090 +0,0 @@
1
- import type * as Rest from "./DiscordREST/Generated.ts"
2
- import type { APIInteraction } from "discord-api-types/v10"
3
-
4
- export * from "./DiscordREST/Generated.ts"
5
- export type {
6
- APIInteraction,
7
- APIBaseApplicationCommandInteractionData,
8
- APIApplicationCommandAutocompleteInteraction,
9
- APIAutocompleteApplicationCommandInteractionData,
10
- APIApplicationCommandInteractionDataOption,
11
- APIApplicationCommandInteraction,
12
- APIApplicationCommandSubcommandOption,
13
- APIApplicationCommandInteractionDataSubcommandOption,
14
- APIChatInputApplicationCommandInteraction,
15
- APIChatInputApplicationCommandInteractionData,
16
- APIChatInputApplicationCommandDMInteraction,
17
- APIChatInputApplicationCommandGuildInteraction,
18
- APIMessageApplicationCommandInteraction,
19
- APIMessageComponentInteraction,
20
- APIMessageComponentInteractionData,
21
- APIModalSubmitInteraction,
22
- APIModalSubmission,
23
- APIPingInteraction,
24
- } from "discord-api-types/v10"
25
- export {
26
- MessageFlags,
27
- PermissionFlagsBits as Permissions,
28
- EmbedType,
29
- } from "discord-api-types/v10"
30
-
31
- export type Snowflake = Rest.SnowflakeType
32
-
33
- export type APIApplication = Rest.ApplicationResponse
34
- export type APIApplicationCommandPermission = Rest.ApplicationCommandPermission
35
- export type APIAutoModerationRule = Rest.GetAutoModerationRule200
36
- export type APIAutoModerationActionMetadata =
37
- | Rest.BlockMessageActionMetadata
38
- | Rest.QuarantineUserActionMetadata
39
- | Rest.FlagToChannelActionMetadata
40
- | Rest.UserCommunicationDisabledActionMetadata
41
- interface APIAutoModerationAction {
42
- readonly type: Rest.AutomodActionType
43
- readonly metadata?: APIAutoModerationActionMetadata
44
- }
45
- export type APIChannel = Rest.GetChannel200
46
- export type APIEmoji = Rest.EmojiResponse
47
- export type APIGuild = Rest.GuildResponse
48
- export type APIGuildIntegration = Rest.ListGuildIntegrations200[number]
49
- export type APIGuildMember = Rest.GuildMemberResponse
50
- export type APIGuildScheduledEvent = Rest.ScheduledEventResponse
51
- export type APIMessage = Rest.MessageResponse
52
- export type APIRole = Rest.GuildRoleResponse
53
- export type APIStageInstance = Rest.StageInstanceResponse
54
- export type APISticker = Rest.GuildStickerResponse
55
- export type APIThreadChannel = Rest.ThreadResponse
56
- export type APIThreadMember = Rest.ThreadMemberResponse
57
- export interface APIUnavailableGuild {
58
- readonly id: Snowflake
59
- readonly unavailable: boolean
60
- }
61
- export type APIUser = Rest.UserResponse
62
- export type APIVoiceState = Rest.VoiceStateResponse
63
- export type InviteTargetType = Rest.InviteTargetTypes
64
- export type AutoModerationRuleTriggerType = Rest.AutomodTriggerType
65
- export type GatewayAuditLogEntry = Rest.AuditLogEntryResponse
66
- export type APIAuditLogEntry = Rest.AuditLogEntryResponse
67
- export type APIEntitlement = Rest.EntitlementResponse
68
- export type ChannelType = Rest.ChannelTypes
69
- export interface APISubscription {
70
- /**
71
- * ID of the subscription
72
- */
73
- id: Snowflake
74
- /**
75
- * ID of the user who is subscribed
76
- */
77
- user_id: Snowflake
78
- /**
79
- * List of SKUs subscribed to
80
- */
81
- sku_ids: Array<Snowflake>
82
- /**
83
- * List of entitlements granted for this subscription
84
- */
85
- entitlement_ids: Array<Snowflake>
86
- /**
87
- * List of SKUs that this user will be subscribed to at renewal
88
- */
89
- renewal_sku_ids: Array<Snowflake> | null
90
- /**
91
- * Start of the current subscription period
92
- */
93
- current_period_start: string
94
- /**
95
- * End of the current subscription period
96
- */
97
- current_period_end: string
98
- /**
99
- * Current status of the subscription
100
- */
101
- status: SubscriptionStatus
102
- /**
103
- * When the subscription was canceled
104
- */
105
- canceled_at: string | null
106
- /**
107
- * ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.
108
- */
109
- country?: string
110
- }
111
- export enum SubscriptionStatus {
112
- /**
113
- * Subscription is active and scheduled to renew.
114
- */
115
- Active,
116
- /**
117
- * Subscription is active but will not renew.
118
- */
119
- Ending,
120
- /**
121
- * Subscription is inactive and not being charged.
122
- */
123
- Inactive,
124
- }
125
- export type APISoundboardSound = Rest.SoundboardSoundResponse
126
- export type GuildChannelType = Rest.GuildChannelResponse["type"]
127
- export type ThreadChannelType = Rest.ThreadResponse["type"]
128
- export type ReactionType = Rest.ReactionTypes
129
-
130
- type RawGatewayPresenceUpdate = GatewayPresenceUpdate
131
- type RawGatewayThreadListSync = GatewayThreadListSync
132
- type RawGatewayThreadMembersUpdate = GatewayThreadMembersUpdate
133
-
134
- type _Nullable<T> = {
135
- [P in keyof T]: T[P] | null
136
- }
137
-
138
- export interface InteractionDataResolved {
139
- readonly users?: Record<Snowflake, Rest.UserResponse>
140
- readonly roles?: Record<Snowflake, Rest.GuildRoleResponse>
141
- readonly members?: Record<Snowflake, Rest.GuildMemberResponse>
142
- readonly channels?: Record<Snowflake, Rest.GuildChannelResponse>
143
- readonly messages?: Record<Snowflake, Rest.MessageResponse>
144
- readonly attachments?: Record<Snowflake, Rest.AttachmentResponse>
145
- }
146
-
147
- export type MessageComponent = Rest.MessageResponse["components"][number]
148
-
149
- export type AllComponents =
150
- | MessageComponent
151
- | (Rest.ActionRowComponentResponse["components"] & {})[number]
152
-
153
- export type DistributedGatewayDispatchPayload =
154
- GatewayDispatchPayload extends infer Payload
155
- ? Payload extends _DataPayload<infer Event, infer D>
156
- ? Event extends Event
157
- ? _DataPayload<Event, D>
158
- : never
159
- : Payload
160
- : never
161
-
162
- // =============================================================================
163
-
164
- /**
165
- * The following types have been taken from the discord-api-types package under
166
- * the MIT license.
167
- */
168
-
169
- // =============================================================================
170
-
171
- /**
172
- * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes}
173
- */
174
- export enum GatewayOpcodes {
175
- /**
176
- * An event was dispatched
177
- */
178
- Dispatch,
179
- /**
180
- * A bidirectional opcode to maintain an active gateway connection.
181
- * Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client.
182
- */
183
- Heartbeat,
184
- /**
185
- * Starts a new session during the initial handshake
186
- */
187
- Identify,
188
- /**
189
- * Update the client's presence
190
- */
191
- PresenceUpdate,
192
- /**
193
- * Used to join/leave or move between voice channels
194
- */
195
- VoiceStateUpdate,
196
- /**
197
- * Resume a previous session that was disconnected
198
- */
199
- Resume = 6,
200
- /**
201
- * You should attempt to reconnect and resume immediately
202
- */
203
- Reconnect,
204
- /**
205
- * Request information about offline guild members in a large guild
206
- */
207
- RequestGuildMembers,
208
- /**
209
- * The session has been invalidated. You should reconnect and identify/resume accordingly
210
- */
211
- InvalidSession,
212
- /**
213
- * Sent immediately after connecting, contains the `heartbeat_interval` to use
214
- */
215
- Hello,
216
- /**
217
- * Sent in response to receiving a heartbeat to acknowledge that it has been received
218
- */
219
- HeartbeatAck,
220
- /**
221
- * Request information about soundboard sounds in a set of guilds
222
- */
223
- RequestSoundboardSounds = 31,
224
- }
225
-
226
- /**
227
- * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes}
228
- */
229
- export enum GatewayCloseCodes {
230
- /**
231
- * We're not sure what went wrong. Try reconnecting?
232
- */
233
- UnknownError = 4_000,
234
- /**
235
- * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that!
236
- *
237
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure}
238
- */
239
- UnknownOpcode,
240
- /**
241
- * You sent an invalid payload to us. Don't do that!
242
- *
243
- * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events}
244
- */
245
- DecodeError,
246
- /**
247
- * You sent us a payload prior to identifying
248
- *
249
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify}
250
- */
251
- NotAuthenticated,
252
- /**
253
- * The account token sent with your identify payload is incorrect
254
- *
255
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify}
256
- */
257
- AuthenticationFailed,
258
- /**
259
- * You sent more than one identify payload. Don't do that!
260
- */
261
- AlreadyAuthenticated,
262
- /**
263
- * The sequence sent when resuming the session was invalid. Reconnect and start a new session
264
- *
265
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume}
266
- */
267
- InvalidSeq = 4_007,
268
- /**
269
- * Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this
270
- */
271
- RateLimited,
272
- /**
273
- * Your session timed out. Reconnect and start a new one
274
- */
275
- SessionTimedOut,
276
- /**
277
- * You sent us an invalid shard when identifying
278
- *
279
- * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
280
- */
281
- InvalidShard,
282
- /**
283
- * The session would have handled too many guilds - you are required to shard your connection in order to connect
284
- *
285
- * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
286
- */
287
- ShardingRequired,
288
- /**
289
- * You sent an invalid version for the gateway
290
- */
291
- InvalidAPIVersion,
292
- /**
293
- * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value
294
- *
295
- * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
296
- */
297
- InvalidIntents,
298
- /**
299
- * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not
300
- * enabled or are not whitelisted for
301
- *
302
- * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
303
- * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents}
304
- */
305
- DisallowedIntents,
306
- }
307
-
308
- /**
309
- * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents}
310
- */
311
- export const GatewayIntentBits = {
312
- Guilds: 1 << 0,
313
- GuildMembers: 1 << 1,
314
- GuildModeration: 1 << 2,
315
- GuildExpressions: 1 << 3,
316
- GuildIntegrations: 1 << 4,
317
- GuildWebhooks: 1 << 5,
318
- GuildInvites: 1 << 6,
319
- GuildVoiceStates: 1 << 7,
320
- GuildPresences: 1 << 8,
321
- GuildMessages: 1 << 9,
322
- GuildMessageReactions: 1 << 10,
323
- GuildMessageTyping: 1 << 11,
324
- DirectMessages: 1 << 12,
325
- DirectMessageReactions: 1 << 13,
326
- DirectMessageTyping: 1 << 14,
327
- MessageContent: 1 << 15,
328
- GuildScheduledEvents: 1 << 16,
329
- AutoModerationConfiguration: 1 << 20,
330
- AutoModerationExecution: 1 << 21,
331
- GuildMessagePolls: 1 << 24,
332
- DirectMessagePolls: 1 << 25,
333
- } as const
334
- export type GatewayIntentBits =
335
- (typeof GatewayIntentBits)[keyof typeof GatewayIntentBits]
336
-
337
- /**
338
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
339
- */
340
- export enum GatewayDispatchEvents {
341
- ApplicationCommandPermissionsUpdate = "APPLICATION_COMMAND_PERMISSIONS_UPDATE",
342
- AutoModerationActionExecution = "AUTO_MODERATION_ACTION_EXECUTION",
343
- AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE",
344
- AutoModerationRuleDelete = "AUTO_MODERATION_RULE_DELETE",
345
- AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE",
346
- ChannelCreate = "CHANNEL_CREATE",
347
- ChannelDelete = "CHANNEL_DELETE",
348
- ChannelPinsUpdate = "CHANNEL_PINS_UPDATE",
349
- ChannelUpdate = "CHANNEL_UPDATE",
350
- EntitlementCreate = "ENTITLEMENT_CREATE",
351
- EntitlementDelete = "ENTITLEMENT_DELETE",
352
- EntitlementUpdate = "ENTITLEMENT_UPDATE",
353
- GuildAuditLogEntryCreate = "GUILD_AUDIT_LOG_ENTRY_CREATE",
354
- GuildBanAdd = "GUILD_BAN_ADD",
355
- GuildBanRemove = "GUILD_BAN_REMOVE",
356
- GuildCreate = "GUILD_CREATE",
357
- GuildDelete = "GUILD_DELETE",
358
- GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE",
359
- GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE",
360
- GuildMemberAdd = "GUILD_MEMBER_ADD",
361
- GuildMemberRemove = "GUILD_MEMBER_REMOVE",
362
- GuildMembersChunk = "GUILD_MEMBERS_CHUNK",
363
- GuildMemberUpdate = "GUILD_MEMBER_UPDATE",
364
- GuildRoleCreate = "GUILD_ROLE_CREATE",
365
- GuildRoleDelete = "GUILD_ROLE_DELETE",
366
- GuildRoleUpdate = "GUILD_ROLE_UPDATE",
367
- GuildScheduledEventCreate = "GUILD_SCHEDULED_EVENT_CREATE",
368
- GuildScheduledEventDelete = "GUILD_SCHEDULED_EVENT_DELETE",
369
- GuildScheduledEventUpdate = "GUILD_SCHEDULED_EVENT_UPDATE",
370
- GuildScheduledEventUserAdd = "GUILD_SCHEDULED_EVENT_USER_ADD",
371
- GuildScheduledEventUserRemove = "GUILD_SCHEDULED_EVENT_USER_REMOVE",
372
- GuildSoundboardSoundCreate = "GUILD_SOUNDBOARD_SOUND_CREATE",
373
- GuildSoundboardSoundDelete = "GUILD_SOUNDBOARD_SOUND_DELETE",
374
- GuildSoundboardSoundsUpdate = "GUILD_SOUNDBOARD_SOUNDS_UPDATE",
375
- GuildSoundboardSoundUpdate = "GUILD_SOUNDBOARD_SOUND_UPDATE",
376
- SoundboardSounds = "SOUNDBOARD_SOUNDS",
377
- GuildStickersUpdate = "GUILD_STICKERS_UPDATE",
378
- GuildUpdate = "GUILD_UPDATE",
379
- IntegrationCreate = "INTEGRATION_CREATE",
380
- IntegrationDelete = "INTEGRATION_DELETE",
381
- IntegrationUpdate = "INTEGRATION_UPDATE",
382
- InteractionCreate = "INTERACTION_CREATE",
383
- InviteCreate = "INVITE_CREATE",
384
- InviteDelete = "INVITE_DELETE",
385
- MessageCreate = "MESSAGE_CREATE",
386
- MessageDelete = "MESSAGE_DELETE",
387
- MessageDeleteBulk = "MESSAGE_DELETE_BULK",
388
- MessagePollVoteAdd = "MESSAGE_POLL_VOTE_ADD",
389
- MessagePollVoteRemove = "MESSAGE_POLL_VOTE_REMOVE",
390
- MessageReactionAdd = "MESSAGE_REACTION_ADD",
391
- MessageReactionRemove = "MESSAGE_REACTION_REMOVE",
392
- MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL",
393
- MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI",
394
- MessageUpdate = "MESSAGE_UPDATE",
395
- PresenceUpdate = "PRESENCE_UPDATE",
396
- Ready = "READY",
397
- Resumed = "RESUMED",
398
- StageInstanceCreate = "STAGE_INSTANCE_CREATE",
399
- StageInstanceDelete = "STAGE_INSTANCE_DELETE",
400
- StageInstanceUpdate = "STAGE_INSTANCE_UPDATE",
401
- SubscriptionCreate = "SUBSCRIPTION_CREATE",
402
- SubscriptionDelete = "SUBSCRIPTION_DELETE",
403
- SubscriptionUpdate = "SUBSCRIPTION_UPDATE",
404
- ThreadCreate = "THREAD_CREATE",
405
- ThreadDelete = "THREAD_DELETE",
406
- ThreadListSync = "THREAD_LIST_SYNC",
407
- ThreadMembersUpdate = "THREAD_MEMBERS_UPDATE",
408
- ThreadMemberUpdate = "THREAD_MEMBER_UPDATE",
409
- ThreadUpdate = "THREAD_UPDATE",
410
- TypingStart = "TYPING_START",
411
- UserUpdate = "USER_UPDATE",
412
- VoiceChannelEffectSend = "VOICE_CHANNEL_EFFECT_SEND",
413
- VoiceServerUpdate = "VOICE_SERVER_UPDATE",
414
- VoiceStateUpdate = "VOICE_STATE_UPDATE",
415
- WebhooksUpdate = "WEBHOOKS_UPDATE",
416
- }
417
-
418
- export type GatewaySendPayload =
419
- | GatewayHeartbeat
420
- | GatewayIdentify
421
- | GatewayRequestGuildMembers
422
- | GatewayRequestSoundboardSounds
423
- | GatewayResume
424
- | GatewayUpdatePresence
425
- | GatewayVoiceStateUpdate
426
-
427
- export type GatewayReceivePayload =
428
- | GatewayDispatchPayload
429
- | GatewayHeartbeatAck
430
- | GatewayHeartbeatRequest
431
- | GatewayHello
432
- | GatewayInvalidSession
433
- | GatewayReconnect
434
-
435
- export type GatewayDispatchPayload =
436
- | GatewayApplicationCommandPermissionsUpdateDispatch
437
- | GatewayAutoModerationActionExecutionDispatch
438
- | GatewayAutoModerationRuleCreateDispatch
439
- | GatewayAutoModerationRuleDeleteDispatch
440
- | GatewayAutoModerationRuleModifyDispatch
441
- | GatewayChannelModifyDispatch
442
- | GatewayChannelPinsUpdateDispatch
443
- | GatewayEntitlementModifyDispatch
444
- | GatewayGuildAuditLogEntryCreateDispatch
445
- | GatewayGuildBanModifyDispatch
446
- | GatewayGuildCreateDispatch
447
- | GatewayGuildDeleteDispatch
448
- | GatewayGuildEmojisUpdateDispatch
449
- | GatewayGuildIntegrationsUpdateDispatch
450
- | GatewayGuildMemberAddDispatch
451
- | GatewayGuildMemberRemoveDispatch
452
- | GatewayGuildMembersChunkDispatch
453
- | GatewayGuildMemberUpdateDispatch
454
- | GatewayGuildModifyDispatch
455
- | GatewayGuildRoleCreateDispatch
456
- | GatewayGuildRoleDeleteDispatch
457
- | GatewayGuildRoleModifyDispatch
458
- | GatewayGuildScheduledEventCreateDispatch
459
- | GatewayGuildScheduledEventDeleteDispatch
460
- | GatewayGuildScheduledEventUpdateDispatch
461
- | GatewayGuildScheduledEventUserAddDispatch
462
- | GatewayGuildScheduledEventUserRemoveDispatch
463
- | GatewayGuildSoundboardSoundCreateDispatch
464
- | GatewayGuildSoundboardSoundDeleteDispatch
465
- | GatewayGuildSoundboardSoundsUpdateDispatch
466
- | GatewayGuildSoundboardSoundUpdateDispatch
467
- | GatewayGuildStickersUpdateDispatch
468
- | GatewayIntegrationCreateDispatch
469
- | GatewayIntegrationDeleteDispatch
470
- | GatewayIntegrationUpdateDispatch
471
- | GatewayInteractionCreateDispatch
472
- | GatewayInviteCreateDispatch
473
- | GatewayInviteDeleteDispatch
474
- | GatewayMessageCreateDispatch
475
- | GatewayMessageDeleteBulkDispatch
476
- | GatewayMessageDeleteDispatch
477
- | GatewayMessagePollVoteAddDispatch
478
- | GatewayMessagePollVoteRemoveDispatch
479
- | GatewayMessageReactionAddDispatch
480
- | GatewayMessageReactionRemoveAllDispatch
481
- | GatewayMessageReactionRemoveDispatch
482
- | GatewayMessageReactionRemoveEmojiDispatch
483
- | GatewayMessageUpdateDispatch
484
- | GatewayPresenceUpdateDispatch
485
- | GatewayReadyDispatch
486
- | GatewayResumedDispatch
487
- | GatewaySoundboardSoundsDispatch
488
- | GatewayStageInstanceCreateDispatch
489
- | GatewayStageInstanceDeleteDispatch
490
- | GatewayStageInstanceUpdateDispatch
491
- | GatewaySubscriptionModifyDispatch
492
- | GatewayThreadCreateDispatch
493
- | GatewayThreadDeleteDispatch
494
- | GatewayThreadListSyncDispatch
495
- | GatewayThreadMembersUpdateDispatch
496
- | GatewayThreadMemberUpdateDispatch
497
- | GatewayThreadUpdateDispatch
498
- | GatewayTypingStartDispatch
499
- | GatewayUserUpdateDispatch
500
- | GatewayVoiceChannelEffectSendDispatch
501
- | GatewayVoiceServerUpdateDispatch
502
- | GatewayVoiceStateUpdateDispatch
503
- | GatewayWebhooksUpdateDispatch
504
-
505
- // #region Dispatch Payloads
506
-
507
- /**
508
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#hello}
509
- */
510
- export interface GatewayHello extends _NonDispatchPayload {
511
- op: GatewayOpcodes.Hello
512
- d: GatewayHelloData
513
- }
514
-
515
- /**
516
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#hello}
517
- */
518
- export interface GatewayHelloData {
519
- /**
520
- * The interval (in milliseconds) the client should heartbeat with
521
- */
522
- heartbeat_interval: number
523
- }
524
-
525
- /**
526
- * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats}
527
- */
528
- export interface GatewayHeartbeatRequest extends _NonDispatchPayload {
529
- op: GatewayOpcodes.Heartbeat
530
- d: never
531
- }
532
-
533
- /**
534
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#heartbeat}
535
- */
536
- export interface GatewayHeartbeatAck extends _NonDispatchPayload {
537
- op: GatewayOpcodes.HeartbeatAck
538
- d: never
539
- }
540
-
541
- /**
542
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#invalid-session}
543
- */
544
- export interface GatewayInvalidSession extends _NonDispatchPayload {
545
- op: GatewayOpcodes.InvalidSession
546
- d: GatewayInvalidSessionData
547
- }
548
-
549
- /**
550
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#invalid-session}
551
- */
552
- export type GatewayInvalidSessionData = boolean
553
-
554
- /**
555
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#reconnect}
556
- */
557
- export interface GatewayReconnect extends _NonDispatchPayload {
558
- op: GatewayOpcodes.Reconnect
559
- d: never
560
- }
561
-
562
- /**
563
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#ready}
564
- */
565
- export type GatewayReadyDispatch = _DataPayload<
566
- GatewayDispatchEvents.Ready,
567
- GatewayReadyDispatchData
568
- >
569
-
570
- /**
571
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#ready}
572
- */
573
- export interface GatewayReadyDispatchData {
574
- /**
575
- * Gateway version
576
- *
577
- * @see {@link https://discord.com/developers/docs/reference#api-versioning}
578
- */
579
- v: number
580
- /**
581
- * Information about the user including email
582
- *
583
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
584
- */
585
- user: APIUser
586
- /**
587
- * The guilds the user is in
588
- *
589
- * @see {@link https://discord.com/developers/docs/resources/guild#unavailable-guild-object}
590
- */
591
- guilds: Array<APIUnavailableGuild>
592
- /**
593
- * Used for resuming connections
594
- */
595
- session_id: string
596
- /**
597
- * Gateway url for resuming connections
598
- */
599
- resume_gateway_url: string
600
- /**
601
- * The shard information associated with this session, if sent when identifying
602
- *
603
- * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
604
- */
605
- shard?: [shard_id: number, shard_count: number]
606
- /**
607
- * Contains `id` and `flags`
608
- *
609
- * @see {@link https://discord.com/developers/docs/resources/application#application-object}
610
- */
611
- application: Pick<APIApplication, "flags" | "id">
612
- }
613
-
614
- /**
615
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#resumed}
616
- */
617
- export type GatewayResumedDispatch = _DataPayload<
618
- GatewayDispatchEvents.Resumed,
619
- never
620
- >
621
-
622
- /**
623
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create}
624
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update}
625
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete}
626
- */
627
- export type GatewayAutoModerationRuleModifyDispatch = _DataPayload<
628
- | GatewayDispatchEvents.AutoModerationRuleCreate
629
- | GatewayDispatchEvents.AutoModerationRuleDelete
630
- | GatewayDispatchEvents.AutoModerationRuleUpdate,
631
- GatewayAutoModerationRuleModifyDispatchData
632
- >
633
-
634
- /**
635
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create}
636
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update}
637
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete}
638
- */
639
- export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule
640
-
641
- /**
642
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create}
643
- */
644
- export type GatewayAutoModerationRuleCreateDispatch =
645
- GatewayAutoModerationRuleModifyDispatch
646
-
647
- /**
648
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-create}
649
- */
650
- export type GatewayAutoModerationRuleCreateDispatchData =
651
- GatewayAutoModerationRuleModifyDispatchData
652
-
653
- /**
654
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update}
655
- */
656
- export type GatewayAutoModerationRuleUpdateDispatch =
657
- GatewayAutoModerationRuleModifyDispatch
658
-
659
- /**
660
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-update}
661
- */
662
- export type GatewayAutoModerationRuleUpdateDispatchData =
663
- GatewayAutoModerationRuleModifyDispatchData
664
-
665
- /**
666
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete}
667
- */
668
- export type GatewayAutoModerationRuleDeleteDispatch =
669
- GatewayAutoModerationRuleModifyDispatch
670
-
671
- /**
672
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-rule-delete}
673
- */
674
- export type GatewayAutoModerationRuleDeleteDispatchData =
675
- GatewayAutoModerationRuleModifyDispatchData
676
-
677
- /**
678
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution}
679
- */
680
- export type GatewayAutoModerationActionExecutionDispatch = _DataPayload<
681
- GatewayDispatchEvents.AutoModerationActionExecution,
682
- GatewayAutoModerationActionExecutionDispatchData
683
- >
684
-
685
- /**
686
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution}
687
- */
688
- export interface GatewayAutoModerationActionExecutionDispatchData {
689
- /**
690
- * The id of the guild in which action was executed
691
- */
692
- guild_id: Snowflake
693
- /**
694
- * The action which was executed
695
- */
696
- action: APIAutoModerationAction
697
- /**
698
- * The id of the rule which action belongs to
699
- */
700
- rule_id: Snowflake
701
- /**
702
- * The trigger type of rule which was triggered
703
- */
704
- rule_trigger_type: AutoModerationRuleTriggerType
705
- /**
706
- * The id of the user which generated the content which triggered the rule
707
- */
708
- user_id: Snowflake
709
- /**
710
- * The id of the channel in which user content was posted
711
- */
712
- channel_id?: Snowflake
713
- /**
714
- * The id of any user message which content belongs to
715
- *
716
- * This field will not be present if message was blocked by AutoMod or content was not part of any message
717
- */
718
- message_id?: Snowflake
719
- /**
720
- * The id of any system auto moderation messages posted as a result of this action
721
- *
722
- * This field will not be present if this event does not correspond to an action with type {@link AutoModerationActionType.SendAlertMessage}
723
- */
724
- alert_system_message_id?: Snowflake
725
- /**
726
- * The user generated text content
727
- *
728
- * `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
729
- */
730
- content: string
731
- /**
732
- * The word or phrase configured in the rule that triggered the rule
733
- */
734
- matched_keyword: string | null
735
- /**
736
- * The substring in content that triggered the rule
737
- *
738
- * `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
739
- */
740
- matched_content: string | null
741
- }
742
-
743
- /**
744
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update}
745
- */
746
- export type GatewayApplicationCommandPermissionsUpdateDispatch = _DataPayload<
747
- GatewayDispatchEvents.ApplicationCommandPermissionsUpdate,
748
- GatewayApplicationCommandPermissionsUpdateDispatchData
749
- >
750
-
751
- /**
752
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#application-command-permissions-update}
753
- */
754
- export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
755
- /**
756
- * ID of the command or the application ID
757
- */
758
- id: Snowflake
759
- /**
760
- * ID of the application the command belongs to
761
- */
762
- application_id: Snowflake
763
- /**
764
- * ID of the guild
765
- */
766
- guild_id: Snowflake
767
- /**
768
- * Permissions for the command in the guild, max of 100
769
- */
770
- permissions: Array<APIApplicationCommandPermission>
771
- }
772
-
773
- /**
774
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create}
775
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update}
776
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete}
777
- */
778
- export type GatewaySubscriptionModifyDispatch = _DataPayload<
779
- | GatewayDispatchEvents.SubscriptionCreate
780
- | GatewayDispatchEvents.SubscriptionDelete
781
- | GatewayDispatchEvents.SubscriptionUpdate,
782
- GatewaySubscriptionModifyDispatchData
783
- >
784
-
785
- /**
786
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create}
787
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update}
788
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete}
789
- */
790
- export type GatewaySubscriptionModifyDispatchData = APISubscription
791
-
792
- /**
793
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create}
794
- */
795
- export type GatewaySubscriptionCreateDispatch =
796
- GatewaySubscriptionModifyDispatch
797
-
798
- /**
799
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-create}
800
- */
801
- export type GatewaySubscriptionCreateDispatchData =
802
- GatewaySubscriptionModifyDispatchData
803
-
804
- /**
805
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update}
806
- */
807
- export type GatewaySubscriptionUpdateDispatch =
808
- GatewaySubscriptionModifyDispatch
809
-
810
- /**
811
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-update}
812
- */
813
- export type GatewaySubscriptionUpdateDispatchData =
814
- GatewaySubscriptionModifyDispatchData
815
-
816
- /**
817
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete}
818
- */
819
- export type GatewaySubscriptionDeleteDispatch =
820
- GatewaySubscriptionModifyDispatch
821
-
822
- /**
823
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#subscription-delete}
824
- */
825
- export type GatewaySubscriptionDeleteDispatchData =
826
- GatewaySubscriptionModifyDispatchData
827
-
828
- /**
829
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create}
830
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update}
831
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete}
832
- */
833
- export type GatewayChannelModifyDispatch = _DataPayload<
834
- | GatewayDispatchEvents.ChannelCreate
835
- | GatewayDispatchEvents.ChannelDelete
836
- | GatewayDispatchEvents.ChannelUpdate,
837
- GatewayChannelModifyDispatchData
838
- >
839
-
840
- /**
841
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create}
842
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update}
843
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete}
844
- */
845
- export type GatewayChannelModifyDispatchData = APIChannel & {
846
- type: Exclude<GuildChannelType, ThreadChannelType>
847
- guild_id: Snowflake
848
- }
849
-
850
- /**
851
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create}
852
- */
853
- export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch
854
-
855
- /**
856
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-create}
857
- */
858
- export type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData
859
-
860
- /**
861
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update}
862
- */
863
- export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch
864
-
865
- /**
866
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-update}
867
- */
868
- export type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData
869
-
870
- /**
871
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete}
872
- */
873
- export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch
874
-
875
- /**
876
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-delete}
877
- */
878
- export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData
879
-
880
- /**
881
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update}
882
- */
883
- export type GatewayChannelPinsUpdateDispatch = _DataPayload<
884
- GatewayDispatchEvents.ChannelPinsUpdate,
885
- GatewayChannelPinsUpdateDispatchData
886
- >
887
-
888
- /**
889
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#channel-pins-update}
890
- */
891
- export interface GatewayChannelPinsUpdateDispatchData {
892
- /**
893
- * The id of the guild
894
- */
895
- guild_id?: Snowflake
896
- /**
897
- * The id of the channel
898
- */
899
- channel_id: Snowflake
900
- /**
901
- * The time at which the most recent pinned message was pinned
902
- */
903
- last_pin_timestamp?: string | null
904
- }
905
-
906
- /**
907
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
908
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update}
909
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete}
910
- */
911
- export type GatewayEntitlementModifyDispatchData = APIEntitlement
912
-
913
- /**
914
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
915
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update}
916
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete}
917
- */
918
- export type GatewayEntitlementModifyDispatch = _DataPayload<
919
- | GatewayDispatchEvents.EntitlementCreate
920
- | GatewayDispatchEvents.EntitlementDelete
921
- | GatewayDispatchEvents.EntitlementUpdate,
922
- GatewayEntitlementModifyDispatchData
923
- >
924
-
925
- /**
926
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
927
- */
928
- export type GatewayEntitlementCreateDispatchData = Omit<
929
- GatewayEntitlementModifyDispatchData,
930
- "ends_at"
931
- > & {
932
- ends_at: GatewayEntitlementModifyDispatchData["ends_at"] | null
933
- }
934
-
935
- /**
936
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-create}
937
- */
938
- export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch
939
-
940
- /**
941
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update}
942
- */
943
- export type GatewayEntitlementUpdateDispatchData =
944
- GatewayEntitlementModifyDispatchData
945
-
946
- /**
947
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-update}
948
- */
949
- export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch
950
-
951
- /**
952
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete}
953
- */
954
- export type GatewayEntitlementDeleteDispatchData =
955
- GatewayEntitlementModifyDispatchData
956
-
957
- /**
958
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#entitlement-delete}
959
- */
960
- export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch
961
-
962
- /**
963
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update}
964
- */
965
- export type GatewayGuildModifyDispatch = _DataPayload<
966
- GatewayDispatchEvents.GuildUpdate,
967
- GatewayGuildModifyDispatchData
968
- >
969
-
970
- /**
971
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update}
972
- */
973
- export type GatewayGuildModifyDispatchData = APIGuild
974
-
975
- /**
976
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create}
977
- */
978
- export type GatewayGuildCreateDispatch = _DataPayload<
979
- GatewayDispatchEvents.GuildCreate,
980
- GatewayGuildCreateDispatchData
981
- >
982
-
983
- /**
984
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create}
985
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-create-guild-create-extra-fields}
986
- */
987
- export interface GatewayGuildCreateDispatchData extends APIGuild {
988
- /**
989
- * When this guild was joined at
990
- *
991
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
992
- */
993
- joined_at: string
994
- /**
995
- * `true` if this is considered a large guild
996
- *
997
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
998
- */
999
- large: boolean
1000
- /**
1001
- * `true` if this guild is unavailable due to an outage
1002
- */
1003
- unavailable?: boolean
1004
- /**
1005
- * Total number of members in this guild
1006
- *
1007
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1008
- */
1009
- member_count: number
1010
- /**
1011
- * States of members currently in voice channels; lacks the `guild_id` key
1012
- *
1013
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1014
- *
1015
- * @see {@link https://discord.com/developers/docs/resources/voice#voice-state-object}
1016
- */
1017
- voice_states: Array<Omit<APIVoiceState, "guild_id">>
1018
- /**
1019
- * Users in the guild
1020
- *
1021
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1022
- *
1023
- * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
1024
- */
1025
- members: Array<APIGuildMember>
1026
- /**
1027
- * Channels in the guild
1028
- *
1029
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1030
- *
1031
- * @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
1032
- */
1033
- channels: Array<
1034
- APIChannel & {
1035
- type: Exclude<GuildChannelType, ThreadChannelType>
1036
- }
1037
- >
1038
- /**
1039
- * Threads in the guild
1040
- *
1041
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1042
- *
1043
- * @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
1044
- */
1045
- threads: Array<APIChannel & { type: ThreadChannelType }>
1046
- /**
1047
- * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
1048
- *
1049
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1050
- *
1051
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
1052
- */
1053
- presences: Array<GatewayPresenceUpdate>
1054
- /**
1055
- * The stage instances in the guild
1056
- *
1057
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1058
- *
1059
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure}
1060
- */
1061
- stage_instances: Array<APIStageInstance>
1062
- /**
1063
- * The scheduled events in the guild
1064
- *
1065
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1066
- *
1067
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object}
1068
- */
1069
- guild_scheduled_events: Array<APIGuildScheduledEvent>
1070
- /**
1071
- * The soundboard sounds in the guild
1072
- *
1073
- * **This field is only sent within the {@link https://discord.com/developers/docs/topics/gateway-events#guild-create | GUILD_CREATE} event**
1074
- *
1075
- * @see {@link https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object}
1076
- */
1077
- soundboard_sounds: Array<APISoundboardSound>
1078
- }
1079
-
1080
- /**
1081
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update}
1082
- */
1083
- export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch
1084
-
1085
- /**
1086
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-update}
1087
- */
1088
- export type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData
1089
-
1090
- /**
1091
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
1092
- */
1093
- export type GatewayGuildDeleteDispatch = _DataPayload<
1094
- GatewayDispatchEvents.GuildDelete,
1095
- GatewayGuildDeleteDispatchData
1096
- >
1097
-
1098
- /**
1099
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-delete}
1100
- */
1101
- export interface GatewayGuildDeleteDispatchData extends Omit<
1102
- APIUnavailableGuild,
1103
- "unavailable"
1104
- > {
1105
- /**
1106
- * `true` if this guild is unavailable due to an outage
1107
- *
1108
- * If the field is not set, the user was removed from the guild.
1109
- */
1110
- unavailable?: true
1111
- }
1112
-
1113
- /**
1114
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add}
1115
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove}
1116
- */
1117
- export type GatewayGuildBanModifyDispatch = _DataPayload<
1118
- GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove,
1119
- GatewayGuildBanModifyDispatchData
1120
- >
1121
-
1122
- /**
1123
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add}
1124
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove}
1125
- */
1126
- export interface GatewayGuildBanModifyDispatchData {
1127
- /**
1128
- * ID of the guild
1129
- */
1130
- guild_id: Snowflake
1131
- /**
1132
- * The banned user
1133
- *
1134
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
1135
- */
1136
- user: APIUser
1137
- }
1138
-
1139
- /**
1140
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add}
1141
- */
1142
- export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch
1143
-
1144
- /**
1145
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-add}
1146
- */
1147
- export type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData
1148
-
1149
- /**
1150
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove}
1151
- */
1152
- export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch
1153
-
1154
- /**
1155
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-ban-remove}
1156
- */
1157
- export type GatewayGuildBanRemoveDispatchData =
1158
- GatewayGuildBanModifyDispatchData
1159
-
1160
- /**
1161
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update}
1162
- */
1163
- export type GatewayGuildEmojisUpdateDispatch = _DataPayload<
1164
- GatewayDispatchEvents.GuildEmojisUpdate,
1165
- GatewayGuildEmojisUpdateDispatchData
1166
- >
1167
-
1168
- /**
1169
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-emojis-update}
1170
- */
1171
- export interface GatewayGuildEmojisUpdateDispatchData {
1172
- /**
1173
- * ID of the guild
1174
- */
1175
- guild_id: Snowflake
1176
- /**
1177
- * Array of emojis
1178
- *
1179
- * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
1180
- */
1181
- emojis: Array<APIEmoji>
1182
- }
1183
-
1184
- /**
1185
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update}
1186
- */
1187
- export type GatewayGuildStickersUpdateDispatch = _DataPayload<
1188
- GatewayDispatchEvents.GuildStickersUpdate,
1189
- GatewayGuildStickersUpdateDispatchData
1190
- >
1191
-
1192
- /**
1193
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-stickers-update}
1194
- */
1195
- export interface GatewayGuildStickersUpdateDispatchData {
1196
- /**
1197
- * ID of the guild
1198
- */
1199
- guild_id: Snowflake
1200
- /**
1201
- * Array of stickers
1202
- *
1203
- * @see {@link https://discord.com/developers/docs/resources/sticker#sticker-object}
1204
- */
1205
- stickers: Array<APISticker>
1206
- }
1207
-
1208
- /**
1209
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update}
1210
- */
1211
- export type GatewayGuildIntegrationsUpdateDispatch = _DataPayload<
1212
- GatewayDispatchEvents.GuildIntegrationsUpdate,
1213
- GatewayGuildIntegrationsUpdateDispatchData
1214
- >
1215
-
1216
- /**
1217
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-integrations-update}
1218
- */
1219
- export interface GatewayGuildIntegrationsUpdateDispatchData {
1220
- /**
1221
- * ID of the guild whose integrations were updated
1222
- */
1223
- guild_id: Snowflake
1224
- }
1225
-
1226
- /**
1227
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-add}
1228
- */
1229
- export type GatewayGuildMemberAddDispatch = _DataPayload<
1230
- GatewayDispatchEvents.GuildMemberAdd,
1231
- GatewayGuildMemberAddDispatchData
1232
- >
1233
-
1234
- /**
1235
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-add}
1236
- */
1237
- export interface GatewayGuildMemberAddDispatchData extends APIGuildMember {
1238
- /**
1239
- * The id of the guild
1240
- */
1241
- guild_id: Snowflake
1242
- }
1243
-
1244
- /**
1245
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-remove}
1246
- */
1247
- export type GatewayGuildMemberRemoveDispatch = _DataPayload<
1248
- GatewayDispatchEvents.GuildMemberRemove,
1249
- GatewayGuildMemberRemoveDispatchData
1250
- >
1251
-
1252
- /**
1253
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-remove}
1254
- */
1255
- export interface GatewayGuildMemberRemoveDispatchData {
1256
- /**
1257
- * The id of the guild
1258
- */
1259
- guild_id: Snowflake
1260
- /**
1261
- * The user who was removed
1262
- *
1263
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
1264
- */
1265
- user: APIUser
1266
- }
1267
-
1268
- /**
1269
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
1270
- */
1271
- export type GatewayGuildMemberUpdateDispatch = _DataPayload<
1272
- GatewayDispatchEvents.GuildMemberUpdate,
1273
- GatewayGuildMemberUpdateDispatchData
1274
- >
1275
-
1276
- /**
1277
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-member-update}
1278
- */
1279
- export type GatewayGuildMemberUpdateDispatchData = _Nullable<
1280
- Pick<APIGuildMember, "joined_at">
1281
- > &
1282
- Omit<APIGuildMember, "deaf" | "flags" | "joined_at" | "mute" | "user"> &
1283
- Partial<Pick<APIGuildMember, "deaf" | "flags" | "mute">> &
1284
- Required<Pick<APIGuildMember, "avatar" | "banner" | "user">> & {
1285
- /**
1286
- * The id of the guild
1287
- */
1288
- guild_id: Snowflake
1289
- }
1290
-
1291
- /**
1292
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
1293
- */
1294
- export type GatewayGuildMembersChunkDispatch = _DataPayload<
1295
- GatewayDispatchEvents.GuildMembersChunk,
1296
- GatewayGuildMembersChunkDispatchData
1297
- >
1298
-
1299
- /**
1300
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
1301
- */
1302
- export type GatewayGuildMembersChunkPresence = Omit<
1303
- RawGatewayPresenceUpdate,
1304
- "guild_id"
1305
- >
1306
-
1307
- /**
1308
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
1309
- */
1310
- export interface GatewayGuildMembersChunkDispatchData {
1311
- /**
1312
- * The id of the guild
1313
- */
1314
- guild_id: Snowflake
1315
- /**
1316
- * Set of guild members
1317
- *
1318
- * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
1319
- */
1320
- members: Array<APIGuildMember>
1321
- /**
1322
- * The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)
1323
- */
1324
- chunk_index: number
1325
- /**
1326
- * The total number of expected chunks for this response
1327
- */
1328
- chunk_count: number
1329
- /**
1330
- * If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here
1331
- */
1332
- not_found?: Array<unknown>
1333
- /**
1334
- * If passing true to `REQUEST_GUILD_MEMBERS`, presences of the returned members will be here
1335
- *
1336
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
1337
- */
1338
- presences?: Array<GatewayGuildMembersChunkPresence>
1339
- /**
1340
- * The nonce used in the Guild Members Request
1341
- *
1342
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
1343
- */
1344
- nonce?: string
1345
- }
1346
-
1347
- /**
1348
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create}
1349
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update}
1350
- */
1351
- export type GatewayGuildRoleModifyDispatch = _DataPayload<
1352
- GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate,
1353
- GatewayGuildRoleModifyDispatchData
1354
- >
1355
-
1356
- /**
1357
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create}
1358
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update}
1359
- */
1360
- export interface GatewayGuildRoleModifyDispatchData {
1361
- /**
1362
- * The id of the guild
1363
- */
1364
- guild_id: Snowflake
1365
- /**
1366
- * The role created or updated
1367
- *
1368
- * @see {@link https://discord.com/developers/docs/topics/permissions#role-object}
1369
- */
1370
- role: APIRole
1371
- }
1372
-
1373
- /**
1374
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create}
1375
- */
1376
- export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch
1377
-
1378
- /**
1379
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-create}
1380
- */
1381
- export type GatewayGuildRoleCreateDispatchData =
1382
- GatewayGuildRoleModifyDispatchData
1383
-
1384
- /**
1385
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update}
1386
- */
1387
- export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch
1388
-
1389
- /**
1390
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-update}
1391
- */
1392
- export type GatewayGuildRoleUpdateDispatchData =
1393
- GatewayGuildRoleModifyDispatchData
1394
-
1395
- /**
1396
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-delete}
1397
- */
1398
- export type GatewayGuildRoleDeleteDispatch = _DataPayload<
1399
- GatewayDispatchEvents.GuildRoleDelete,
1400
- GatewayGuildRoleDeleteDispatchData
1401
- >
1402
-
1403
- /**
1404
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-role-delete}
1405
- */
1406
- export interface GatewayGuildRoleDeleteDispatchData {
1407
- /**
1408
- * The id of the guild
1409
- */
1410
- guild_id: Snowflake
1411
- /**
1412
- * The id of the role
1413
- */
1414
- role_id: Snowflake
1415
- }
1416
-
1417
- /**
1418
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create}
1419
- */
1420
- export type GatewayGuildScheduledEventCreateDispatch = _DataPayload<
1421
- GatewayDispatchEvents.GuildScheduledEventCreate,
1422
- GatewayGuildScheduledEventCreateDispatchData
1423
- >
1424
-
1425
- /**
1426
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create}
1427
- */
1428
- export type GatewayGuildScheduledEventCreateDispatchData =
1429
- APIGuildScheduledEvent
1430
-
1431
- /**
1432
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update}
1433
- */
1434
- export type GatewayGuildScheduledEventUpdateDispatch = _DataPayload<
1435
- GatewayDispatchEvents.GuildScheduledEventUpdate,
1436
- GatewayGuildScheduledEventUpdateDispatchData
1437
- >
1438
-
1439
- /**
1440
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update}
1441
- */
1442
- export type GatewayGuildScheduledEventUpdateDispatchData =
1443
- APIGuildScheduledEvent
1444
-
1445
- /**
1446
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete}
1447
- */
1448
- export type GatewayGuildScheduledEventDeleteDispatch = _DataPayload<
1449
- GatewayDispatchEvents.GuildScheduledEventDelete,
1450
- GatewayGuildScheduledEventDeleteDispatchData
1451
- >
1452
-
1453
- /**
1454
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete}
1455
- */
1456
- export type GatewayGuildScheduledEventDeleteDispatchData =
1457
- APIGuildScheduledEvent
1458
-
1459
- /**
1460
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add}
1461
- */
1462
- export type GatewayGuildScheduledEventUserAddDispatch = _DataPayload<
1463
- GatewayDispatchEvents.GuildScheduledEventUserAdd,
1464
- GatewayGuildScheduledEventUserAddDispatchData
1465
- >
1466
-
1467
- /**
1468
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add}
1469
- */
1470
- export interface GatewayGuildScheduledEventUserAddDispatchData {
1471
- guild_scheduled_event_id: Snowflake
1472
- user_id: Snowflake
1473
- guild_id: Snowflake
1474
- }
1475
-
1476
- /**
1477
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove}
1478
- */
1479
- export type GatewayGuildScheduledEventUserRemoveDispatch = _DataPayload<
1480
- GatewayDispatchEvents.GuildScheduledEventUserRemove,
1481
- GatewayGuildScheduledEventUserAddDispatchData
1482
- >
1483
-
1484
- /**
1485
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove}
1486
- */
1487
- export interface GatewayGuildScheduledEventUserRemoveDispatchData {
1488
- guild_scheduled_event_id: Snowflake
1489
- user_id: Snowflake
1490
- guild_id: Snowflake
1491
- }
1492
-
1493
- /**
1494
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create}
1495
- */
1496
- export type GatewayGuildSoundboardSoundCreateDispatch = _DataPayload<
1497
- GatewayDispatchEvents.GuildSoundboardSoundCreate,
1498
- GatewayGuildSoundboardSoundCreateDispatchData
1499
- >
1500
-
1501
- /**
1502
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create}
1503
- */
1504
- export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound
1505
-
1506
- /**
1507
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update}
1508
- */
1509
- export type GatewayGuildSoundboardSoundUpdateDispatch = _DataPayload<
1510
- GatewayDispatchEvents.GuildSoundboardSoundUpdate,
1511
- GatewayGuildSoundboardSoundUpdateDispatchData
1512
- >
1513
-
1514
- /**
1515
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update}
1516
- */
1517
- export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound
1518
-
1519
- /**
1520
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete}
1521
- */
1522
- export type GatewayGuildSoundboardSoundDeleteDispatch = _DataPayload<
1523
- GatewayDispatchEvents.GuildSoundboardSoundDelete,
1524
- GatewayGuildSoundboardSoundDeleteDispatchData
1525
- >
1526
-
1527
- /**
1528
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete}
1529
- */
1530
- export interface GatewayGuildSoundboardSoundDeleteDispatchData {
1531
- /**
1532
- * The id of the sound that was deleted
1533
- */
1534
- sound_id: Snowflake
1535
- /**
1536
- * The id of the guild the sound was in
1537
- */
1538
- guild_id: Snowflake
1539
- }
1540
-
1541
- /**
1542
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update}
1543
- */
1544
- export type GatewayGuildSoundboardSoundsUpdateDispatch = _DataPayload<
1545
- GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
1546
- GatewayGuildSoundboardSoundsUpdateDispatchData
1547
- >
1548
-
1549
- /**
1550
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update}
1551
- */
1552
- export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
1553
- /**
1554
- * The guild's soundboard sounds
1555
- */
1556
- soundboard_sounds: Array<APISoundboardSound>
1557
- /**
1558
- * The id of the guild
1559
- */
1560
- guild_id: Snowflake
1561
- }
1562
-
1563
- /**
1564
- * @see {@link https://discord.com/developers/docs/events/gateway-events#soundboard-sounds}
1565
- */
1566
- export type GatewaySoundboardSoundsDispatch = _DataPayload<
1567
- GatewayDispatchEvents.SoundboardSounds,
1568
- GatewaySoundboardSoundsDispatchData
1569
- >
1570
-
1571
- /**
1572
- * @see {@link https://discord.com/developers/docs/events/gateway-events#soundboard-sounds}
1573
- */
1574
- export interface GatewaySoundboardSoundsDispatchData {
1575
- /**
1576
- * The guild's soundboard sounds
1577
- */
1578
- soundboard_sounds: Array<APISoundboardSound>
1579
- /**
1580
- * The id of the guild
1581
- */
1582
- guild_id: Snowflake
1583
- }
1584
-
1585
- /**
1586
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-create}
1587
- */
1588
- export type GatewayIntegrationCreateDispatch = _DataPayload<
1589
- GatewayDispatchEvents.IntegrationCreate,
1590
- GatewayIntegrationCreateDispatchData
1591
- >
1592
-
1593
- /**
1594
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-create}
1595
- */
1596
- export type GatewayIntegrationCreateDispatchData = APIGuildIntegration & {
1597
- guild_id: Snowflake
1598
- }
1599
-
1600
- /**
1601
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update}
1602
- */
1603
- export type GatewayIntegrationUpdateDispatch = _DataPayload<
1604
- GatewayDispatchEvents.IntegrationUpdate,
1605
- GatewayIntegrationUpdateDispatchData
1606
- >
1607
-
1608
- /**
1609
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update}
1610
- */
1611
- export type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & {
1612
- guild_id: Snowflake
1613
- }
1614
-
1615
- /**
1616
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-update}
1617
- */
1618
- export type GatewayIntegrationDeleteDispatch = _DataPayload<
1619
- GatewayDispatchEvents.IntegrationDelete,
1620
- GatewayIntegrationDeleteDispatchData
1621
- >
1622
-
1623
- /**
1624
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#integration-delete}
1625
- */
1626
- export interface GatewayIntegrationDeleteDispatchData {
1627
- /**
1628
- * Integration id
1629
- */
1630
- id: Snowflake
1631
- /**
1632
- * ID of the guild
1633
- */
1634
- guild_id: Snowflake
1635
- /**
1636
- * ID of the bot/OAuth2 application for this Discord integration
1637
- */
1638
- application_id?: Snowflake
1639
- }
1640
-
1641
- /**
1642
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#interaction-create}
1643
- */
1644
- export type GatewayInteractionCreateDispatch = _DataPayload<
1645
- GatewayDispatchEvents.InteractionCreate,
1646
- GatewayInteractionCreateDispatchData
1647
- >
1648
-
1649
- /**
1650
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#interaction-create}
1651
- */
1652
- export type GatewayInteractionCreateDispatchData = APIInteraction
1653
-
1654
- /**
1655
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-create}
1656
- */
1657
- export type GatewayInviteCreateDispatch = _DataPayload<
1658
- GatewayDispatchEvents.InviteCreate,
1659
- GatewayInviteCreateDispatchData
1660
- >
1661
-
1662
- /**
1663
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-create}
1664
- */
1665
- export interface GatewayInviteCreateDispatchData {
1666
- /**
1667
- * The channel the invite is for
1668
- */
1669
- channel_id: Snowflake
1670
- /**
1671
- * The unique invite code
1672
- *
1673
- * @see {@link https://discord.com/developers/docs/resources/invite#invite-object}
1674
- */
1675
- code: string
1676
- /**
1677
- * The time at which the invite was created
1678
- */
1679
- created_at: number
1680
- /**
1681
- * The guild of the invite
1682
- */
1683
- guild_id?: Snowflake
1684
- /**
1685
- * The user that created the invite
1686
- *
1687
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
1688
- */
1689
- inviter?: APIUser
1690
- /**
1691
- * How long the invite is valid for (in seconds)
1692
- */
1693
- max_age: number
1694
- /**
1695
- * The maximum number of times the invite can be used
1696
- */
1697
- max_uses: number
1698
- /**
1699
- * The type of target for this voice channel invite
1700
- *
1701
- * @see {@link https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types}
1702
- */
1703
- target_type?: InviteTargetType
1704
- /**
1705
- * The user whose stream to display for this voice channel stream invite
1706
- *
1707
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
1708
- */
1709
- target_user?: APIUser
1710
- /**
1711
- * The embedded application to open for this voice channel embedded application invite
1712
- */
1713
- target_application?: Partial<APIApplication>
1714
- /**
1715
- * Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role)
1716
- */
1717
- temporary: boolean
1718
- /**
1719
- * How many times the invite has been used (always will be `0`)
1720
- */
1721
- uses: 0
1722
- }
1723
-
1724
- /**
1725
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-delete}
1726
- */
1727
- export type GatewayInviteDeleteDispatch = _DataPayload<
1728
- GatewayDispatchEvents.InviteDelete,
1729
- GatewayInviteDeleteDispatchData
1730
- >
1731
-
1732
- /**
1733
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#invite-delete}
1734
- */
1735
- export interface GatewayInviteDeleteDispatchData {
1736
- /**
1737
- * The channel of the invite
1738
- */
1739
- channel_id: Snowflake
1740
- /**
1741
- * The guild of the invite
1742
- */
1743
- guild_id?: Snowflake
1744
- /**
1745
- * The unique invite code
1746
- *
1747
- * @see {@link https://discord.com/developers/docs/resources/invite#invite-object}
1748
- */
1749
- code: string
1750
- }
1751
-
1752
- /**
1753
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
1754
- */
1755
- export type GatewayMessageCreateDispatch = _DataPayload<
1756
- GatewayDispatchEvents.MessageCreate,
1757
- GatewayMessageCreateDispatchData
1758
- >
1759
-
1760
- /**
1761
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create}
1762
- */
1763
- export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields &
1764
- Omit<APIMessage, "mentions">
1765
-
1766
- /**
1767
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
1768
- */
1769
- export type GatewayMessageUpdateDispatch = _DataPayload<
1770
- GatewayDispatchEvents.MessageUpdate,
1771
- GatewayMessageUpdateDispatchData
1772
- >
1773
-
1774
- /**
1775
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-update}
1776
- */
1777
- export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
1778
- Omit<APIMessage, "mentions">
1779
-
1780
- /**
1781
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields}
1782
- */
1783
- export interface GatewayMessageEventExtraFields {
1784
- /**
1785
- * ID of the guild the message was sent in
1786
- */
1787
- guild_id?: Snowflake
1788
- /**
1789
- * Member properties for this message's author
1790
- *
1791
- * The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
1792
- * from text-based guild channels
1793
- *
1794
- * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
1795
- */
1796
- member?: Omit<APIGuildMember, "user">
1797
- /**
1798
- * Users specifically mentioned in the message
1799
- *
1800
- * The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
1801
- * from text-based guild channels
1802
- *
1803
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
1804
- * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
1805
- */
1806
- mentions: Array<APIUser & { member?: Omit<APIGuildMember, "user"> }>
1807
- }
1808
-
1809
- /**
1810
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete}
1811
- */
1812
- export type GatewayMessageDeleteDispatch = _DataPayload<
1813
- GatewayDispatchEvents.MessageDelete,
1814
- GatewayMessageDeleteDispatchData
1815
- >
1816
-
1817
- /**
1818
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete}
1819
- */
1820
- export interface GatewayMessageDeleteDispatchData {
1821
- /**
1822
- * The id of the message
1823
- */
1824
- id: Snowflake
1825
- /**
1826
- * The id of the channel
1827
- */
1828
- channel_id: Snowflake
1829
- /**
1830
- * The id of the guild
1831
- */
1832
- guild_id?: Snowflake
1833
- }
1834
-
1835
- /**
1836
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk}
1837
- */
1838
- export type GatewayMessageDeleteBulkDispatch = _DataPayload<
1839
- GatewayDispatchEvents.MessageDeleteBulk,
1840
- GatewayMessageDeleteBulkDispatchData
1841
- >
1842
-
1843
- /**
1844
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-delete-bulk}
1845
- */
1846
- export interface GatewayMessageDeleteBulkDispatchData {
1847
- /**
1848
- * The ids of the messages
1849
- */
1850
- ids: Array<Snowflake>
1851
- /**
1852
- * The id of the channel
1853
- */
1854
- channel_id: Snowflake
1855
- /**
1856
- * The id of the guild
1857
- */
1858
- guild_id?: Snowflake
1859
- }
1860
-
1861
- /**
1862
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
1863
- */
1864
- export type GatewayMessageReactionAddDispatch =
1865
- GatewayMessageReactionData<GatewayDispatchEvents.MessageReactionAdd>
1866
-
1867
- /**
1868
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-add}
1869
- */
1870
- export type GatewayMessageReactionAddDispatchData =
1871
- GatewayMessageReactionAddDispatch["d"]
1872
-
1873
- /**
1874
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
1875
- */
1876
- export type GatewayMessageReactionRemoveDispatch = GatewayMessageReactionData<
1877
- GatewayDispatchEvents.MessageReactionRemove,
1878
- "burst_colors" | "member" | "message_author_id"
1879
- >
1880
-
1881
- /**
1882
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove}
1883
- */
1884
- export type GatewayMessageReactionRemoveDispatchData =
1885
- GatewayMessageReactionRemoveDispatch["d"]
1886
-
1887
- /**
1888
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
1889
- */
1890
- export type GatewayMessageReactionRemoveAllDispatch = _DataPayload<
1891
- GatewayDispatchEvents.MessageReactionRemoveAll,
1892
- GatewayMessageReactionRemoveAllDispatchData
1893
- >
1894
-
1895
- /**
1896
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-all}
1897
- */
1898
- export type GatewayMessageReactionRemoveAllDispatchData =
1899
- GatewayMessageReactionRemoveData
1900
-
1901
- /**
1902
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji}
1903
- */
1904
- export type GatewayMessageReactionRemoveEmojiDispatch = _DataPayload<
1905
- GatewayDispatchEvents.MessageReactionRemoveEmoji,
1906
- GatewayMessageReactionRemoveEmojiDispatchData
1907
- >
1908
-
1909
- /**
1910
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove-emoji}
1911
- */
1912
- export interface GatewayMessageReactionRemoveEmojiDispatchData extends GatewayMessageReactionRemoveData {
1913
- /**
1914
- * The emoji that was removed
1915
- */
1916
- emoji: APIEmoji
1917
- }
1918
-
1919
- /**
1920
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
1921
- */
1922
- export type GatewayPresenceUpdateDispatch = _DataPayload<
1923
- GatewayDispatchEvents.PresenceUpdate,
1924
- GatewayPresenceUpdateDispatchData
1925
- >
1926
-
1927
- /**
1928
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update}
1929
- */
1930
- export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate
1931
-
1932
- /**
1933
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
1934
- */
1935
- export type GatewayStageInstanceCreateDispatch = _DataPayload<
1936
- GatewayDispatchEvents.StageInstanceCreate,
1937
- GatewayStageInstanceCreateDispatchData
1938
- >
1939
-
1940
- /**
1941
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-create}
1942
- */
1943
- export type GatewayStageInstanceCreateDispatchData = APIStageInstance
1944
-
1945
- /**
1946
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete}
1947
- */
1948
- export type GatewayStageInstanceDeleteDispatch = _DataPayload<
1949
- GatewayDispatchEvents.StageInstanceDelete,
1950
- GatewayStageInstanceDeleteDispatchData
1951
- >
1952
-
1953
- /**
1954
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-delete}
1955
- */
1956
- export type GatewayStageInstanceDeleteDispatchData = APIStageInstance
1957
-
1958
- /**
1959
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-update}
1960
- */
1961
- export type GatewayStageInstanceUpdateDispatch = _DataPayload<
1962
- GatewayDispatchEvents.StageInstanceUpdate,
1963
- GatewayStageInstanceUpdateDispatchData
1964
- >
1965
-
1966
- /**
1967
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#stage-instance-update}
1968
- */
1969
- export type GatewayStageInstanceUpdateDispatchData = APIStageInstance
1970
-
1971
- /**
1972
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
1973
- */
1974
- export type GatewayThreadListSyncDispatch = _DataPayload<
1975
- GatewayDispatchEvents.ThreadListSync,
1976
- GatewayThreadListSyncDispatchData
1977
- >
1978
-
1979
- /**
1980
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync}
1981
- */
1982
- export type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync
1983
-
1984
- /**
1985
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
1986
- */
1987
- export type GatewayThreadMembersUpdateDispatch = _DataPayload<
1988
- GatewayDispatchEvents.ThreadMembersUpdate,
1989
- GatewayThreadMembersUpdateDispatchData
1990
- >
1991
-
1992
- /**
1993
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update}
1994
- */
1995
- export type GatewayThreadMembersUpdateDispatchData =
1996
- RawGatewayThreadMembersUpdate
1997
-
1998
- /**
1999
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-member-update}
2000
- */
2001
- export type GatewayThreadMemberUpdateDispatch = _DataPayload<
2002
- GatewayDispatchEvents.ThreadMemberUpdate,
2003
- GatewayThreadMemberUpdateDispatchData
2004
- >
2005
-
2006
- /**
2007
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-member-update}
2008
- */
2009
- export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & {
2010
- guild_id: Snowflake
2011
- }
2012
-
2013
- /**
2014
- * @deprecated This type doesn't accurately reflect the Discord API.
2015
- * Use {@link GatewayThreadCreateDispatch},
2016
- * {@link GatewayThreadUpdateDispatch}, or
2017
- * {@link GatewayThreadDeleteDispatch} instead.
2018
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create}
2019
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update}
2020
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete}
2021
- */
2022
- export type GatewayThreadModifyDispatch = _DataPayload<
2023
- | GatewayDispatchEvents.ThreadCreate
2024
- | GatewayDispatchEvents.ThreadDelete
2025
- | GatewayDispatchEvents.ThreadUpdate,
2026
- APIThreadChannel
2027
- >
2028
-
2029
- /**
2030
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create}
2031
- */
2032
- export type GatewayThreadCreateDispatch = _DataPayload<
2033
- GatewayDispatchEvents.ThreadCreate,
2034
- GatewayThreadCreateDispatchData
2035
- >
2036
-
2037
- /**
2038
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-create}
2039
- */
2040
- export interface GatewayThreadCreateDispatchData extends APIThreadChannel {
2041
- /**
2042
- * Whether the thread is newly created or not.
2043
- */
2044
- newly_created?: true
2045
- }
2046
-
2047
- /**
2048
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update}
2049
- */
2050
- export type GatewayThreadUpdateDispatch = _DataPayload<
2051
- GatewayDispatchEvents.ThreadUpdate,
2052
- GatewayThreadUpdateDispatchData
2053
- >
2054
-
2055
- /**
2056
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-update}
2057
- */
2058
- export type GatewayThreadUpdateDispatchData = APIThreadChannel
2059
-
2060
- /**
2061
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete}
2062
- */
2063
- export type GatewayThreadDeleteDispatch = _DataPayload<
2064
- GatewayDispatchEvents.ThreadDelete,
2065
- GatewayThreadDeleteDispatchData
2066
- >
2067
-
2068
- /**
2069
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-delete}
2070
- */
2071
- export interface GatewayThreadDeleteDispatchData {
2072
- /**
2073
- * The id of the channel
2074
- */
2075
- id: Snowflake
2076
- /**
2077
- * The id of the guild
2078
- */
2079
- guild_id: Snowflake
2080
- /**
2081
- * The id of the parent channel of the thread
2082
- */
2083
- parent_id: Snowflake
2084
- /**
2085
- * The type of the channel
2086
- *
2087
- * @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
2088
- */
2089
- type: ChannelType
2090
- }
2091
-
2092
- /**
2093
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#typing-start}
2094
- */
2095
- export type GatewayTypingStartDispatch = _DataPayload<
2096
- GatewayDispatchEvents.TypingStart,
2097
- GatewayTypingStartDispatchData
2098
- >
2099
-
2100
- /**
2101
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#typing-start}
2102
- */
2103
- export interface GatewayTypingStartDispatchData {
2104
- /**
2105
- * The id of the channel
2106
- */
2107
- channel_id: Snowflake
2108
- /**
2109
- * The id of the guild
2110
- */
2111
- guild_id?: Snowflake
2112
- /**
2113
- * The id of the user
2114
- */
2115
- user_id: Snowflake
2116
- /**
2117
- * Unix time (in seconds) of when the user started typing
2118
- */
2119
- timestamp: number
2120
- /**
2121
- * The member who started typing if this happened in a guild
2122
- *
2123
- * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
2124
- */
2125
- member?: APIGuildMember
2126
- }
2127
-
2128
- /**
2129
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#user-update}
2130
- */
2131
- export type GatewayUserUpdateDispatch = _DataPayload<
2132
- GatewayDispatchEvents.UserUpdate,
2133
- GatewayUserUpdateDispatchData
2134
- >
2135
-
2136
- /**
2137
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#user-update}
2138
- */
2139
- export type GatewayUserUpdateDispatchData = APIUser
2140
-
2141
- /**
2142
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send}
2143
- */
2144
- export type GatewayVoiceChannelEffectSendDispatch = _DataPayload<
2145
- GatewayDispatchEvents.VoiceChannelEffectSend,
2146
- GatewayVoiceChannelEffectSendDispatchData
2147
- >
2148
-
2149
- /**
2150
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send}
2151
- */
2152
- export interface GatewayVoiceChannelEffectSendDispatchData {
2153
- /**
2154
- * ID of the channel the effect was sent in
2155
- */
2156
- channel_id: Snowflake
2157
- /**
2158
- * ID of the guild the effect was sent in
2159
- */
2160
- guild_id: Snowflake
2161
- /**
2162
- * ID of the user who sent the effect
2163
- */
2164
- user_id: Snowflake
2165
- /**
2166
- * The emoji sent, for emoji reaction and soundboard effects
2167
- */
2168
- emoji?: APIEmoji | null
2169
- /**
2170
- * The type of emoji animation, for emoji reaction and soundboard effects
2171
- */
2172
- animation_type?: VoiceChannelEffectSendAnimationType | null
2173
- /**
2174
- * The ID of the emoji animation, for emoji reaction and soundboard effects
2175
- */
2176
- animation_id?: number
2177
- /**
2178
- * The ID of the soundboard sound, for soundboard effects
2179
- */
2180
- sound_id?: Snowflake | number
2181
- /**
2182
- * The volume of the soundboard sound, from 0 to 1, for soundboard effects
2183
- */
2184
- sound_volume?: number
2185
- }
2186
-
2187
- /**
2188
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types}
2189
- */
2190
- export enum VoiceChannelEffectSendAnimationType {
2191
- /**
2192
- * A fun animation, sent by a Nitro subscriber
2193
- */
2194
- Premium,
2195
- /**
2196
- * The standard animation
2197
- */
2198
- Basic,
2199
- }
2200
-
2201
- /**
2202
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update}
2203
- */
2204
- export type GatewayVoiceStateUpdateDispatch = _DataPayload<
2205
- GatewayDispatchEvents.VoiceStateUpdate,
2206
- GatewayVoiceStateUpdateDispatchData
2207
- >
2208
-
2209
- /**
2210
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-state-update}
2211
- */
2212
- export type GatewayVoiceStateUpdateDispatchData = APIVoiceState
2213
-
2214
- /**
2215
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-server-update}
2216
- */
2217
- export type GatewayVoiceServerUpdateDispatch = _DataPayload<
2218
- GatewayDispatchEvents.VoiceServerUpdate,
2219
- GatewayVoiceServerUpdateDispatchData
2220
- >
2221
-
2222
- /**
2223
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-server-update}
2224
- */
2225
- export interface GatewayVoiceServerUpdateDispatchData {
2226
- /**
2227
- * Voice connection token
2228
- */
2229
- token: string
2230
- /**
2231
- * The guild this voice server update is for
2232
- */
2233
- guild_id: Snowflake
2234
- /**
2235
- * The voice server host
2236
- *
2237
- * A `null` endpoint means that the voice server allocated has gone away and is trying to be reallocated.
2238
- * You should attempt to disconnect from the currently connected voice server, and not attempt to reconnect
2239
- * until a new voice server is allocated
2240
- */
2241
- endpoint: string | null
2242
- }
2243
-
2244
- /**
2245
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#webhooks-update}
2246
- */
2247
- export type GatewayWebhooksUpdateDispatch = _DataPayload<
2248
- GatewayDispatchEvents.WebhooksUpdate,
2249
- GatewayWebhooksUpdateDispatchData
2250
- >
2251
-
2252
- /**
2253
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#webhooks-update}
2254
- */
2255
- export interface GatewayWebhooksUpdateDispatchData {
2256
- /**
2257
- * The id of the guild
2258
- */
2259
- guild_id: Snowflake
2260
- /**
2261
- * The id of the channel
2262
- */
2263
- channel_id: Snowflake
2264
- }
2265
-
2266
- /**
2267
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create}
2268
- */
2269
- export type GatewayGuildAuditLogEntryCreateDispatch = _DataPayload<
2270
- GatewayDispatchEvents.GuildAuditLogEntryCreate,
2271
- GatewayGuildAuditLogEntryCreateDispatchData
2272
- >
2273
-
2274
- /**
2275
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create}
2276
- */
2277
- export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry {
2278
- /**
2279
- * ID of the guild
2280
- */
2281
- guild_id: Snowflake
2282
- }
2283
-
2284
- /**
2285
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add}
2286
- */
2287
- export type GatewayMessagePollVoteAddDispatch = _DataPayload<
2288
- GatewayDispatchEvents.MessagePollVoteAdd,
2289
- GatewayMessagePollVoteDispatchData
2290
- >
2291
-
2292
- /**
2293
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove}
2294
- */
2295
- export type GatewayMessagePollVoteRemoveDispatch = _DataPayload<
2296
- GatewayDispatchEvents.MessagePollVoteRemove,
2297
- GatewayMessagePollVoteDispatchData
2298
- >
2299
-
2300
- /**
2301
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add}
2302
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove}
2303
- */
2304
- export interface GatewayMessagePollVoteDispatchData {
2305
- /**
2306
- * ID of the user
2307
- */
2308
- user_id: Snowflake
2309
- /**
2310
- * ID of the channel
2311
- */
2312
- channel_id: Snowflake
2313
- /**
2314
- * ID of the message
2315
- */
2316
- message_id: Snowflake
2317
- /**
2318
- * ID of the guild
2319
- */
2320
- guild_id?: Snowflake
2321
- /**
2322
- * ID of the answer
2323
- */
2324
- answer_id: number
2325
- }
2326
-
2327
- // #endregion Dispatch Payloads
2328
-
2329
- // #region Sendable Payloads
2330
-
2331
- /**
2332
- * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats}
2333
- */
2334
- export interface GatewayHeartbeat {
2335
- op: GatewayOpcodes.Heartbeat
2336
- d: GatewayHeartbeatData
2337
- }
2338
-
2339
- /**
2340
- * @see {@link https://discord.com/developers/docs/topics/gateway#sending-heartbeats}
2341
- */
2342
- export type GatewayHeartbeatData = number | null
2343
-
2344
- /**
2345
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify}
2346
- */
2347
- export interface GatewayIdentify {
2348
- op: GatewayOpcodes.Identify
2349
- d: GatewayIdentifyData
2350
- }
2351
-
2352
- /**
2353
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify}
2354
- */
2355
- export interface GatewayIdentifyData {
2356
- /**
2357
- * Authentication token
2358
- */
2359
- token: string
2360
- /**
2361
- * Connection properties
2362
- *
2363
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties}
2364
- */
2365
- properties: GatewayIdentifyProperties
2366
- /**
2367
- * Whether this connection supports compression of packets
2368
- *
2369
- * @defaultValue `false`
2370
- */
2371
- compress?: boolean
2372
- /**
2373
- * Value between 50 and 250, total number of members where the gateway will stop sending
2374
- * offline members in the guild member list
2375
- *
2376
- * @defaultValue `50`
2377
- */
2378
- large_threshold?: number
2379
- /**
2380
- * Used for Guild Sharding
2381
- *
2382
- * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
2383
- */
2384
- shard?: [shard_id: number, shard_count: number]
2385
- /**
2386
- * Presence structure for initial presence information
2387
- *
2388
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
2389
- */
2390
- presence?: GatewayPresenceUpdateData
2391
- /**
2392
- * The Gateway Intents you wish to receive
2393
- *
2394
- * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
2395
- */
2396
- intents: number
2397
- }
2398
-
2399
- /**
2400
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify-identify-connection-properties}
2401
- */
2402
- export interface GatewayIdentifyProperties {
2403
- /**
2404
- * Your operating system
2405
- */
2406
- os: string
2407
- /**
2408
- * Your library name
2409
- */
2410
- browser: string
2411
- /**
2412
- * Your library name
2413
- */
2414
- device: string
2415
- }
2416
-
2417
- /**
2418
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume}
2419
- */
2420
- export interface GatewayResume {
2421
- op: GatewayOpcodes.Resume
2422
- d: GatewayResumeData
2423
- }
2424
-
2425
- /**
2426
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume}
2427
- */
2428
- export interface GatewayResumeData {
2429
- /**
2430
- * Session token
2431
- */
2432
- token: string
2433
- /**
2434
- * Session id
2435
- */
2436
- session_id: string
2437
- /**
2438
- * Last sequence number received
2439
- */
2440
- seq: number
2441
- }
2442
-
2443
- /**
2444
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
2445
- */
2446
- export interface GatewayRequestGuildMembers {
2447
- op: GatewayOpcodes.RequestGuildMembers
2448
- d: GatewayRequestGuildMembersData
2449
- }
2450
-
2451
- /**
2452
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
2453
- */
2454
- export interface GatewayRequestGuildMembersDataBase {
2455
- /**
2456
- * ID of the guild to get members for
2457
- */
2458
- guild_id: Snowflake
2459
- /**
2460
- * Used to specify if we want the presences of the matched members
2461
- */
2462
- presences?: boolean
2463
- /**
2464
- * Nonce to identify the Guild Members Chunk response
2465
- *
2466
- * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set.
2467
- *
2468
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#guild-members-chunk}
2469
- */
2470
- nonce?: string
2471
- }
2472
-
2473
- /**
2474
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
2475
- */
2476
- export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
2477
- /**
2478
- * Used to specify which users you wish to fetch
2479
- */
2480
- user_ids: Snowflake | Array<Snowflake>
2481
- }
2482
-
2483
- /**
2484
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
2485
- */
2486
- export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
2487
- /**
2488
- * String that username starts with, or an empty string to return all members
2489
- */
2490
- query: string
2491
- /**
2492
- * Maximum number of members to send matching the `query`;
2493
- * a limit of `0` can be used with an empty string `query` to return all members
2494
- */
2495
- limit: number
2496
- }
2497
-
2498
- /**
2499
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-guild-members}
2500
- */
2501
- export type GatewayRequestGuildMembersData =
2502
- | GatewayRequestGuildMembersDataWithQuery
2503
- | GatewayRequestGuildMembersDataWithUserIds
2504
-
2505
- /**
2506
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
2507
- */
2508
- export interface GatewayRequestSoundboardSounds {
2509
- op: GatewayOpcodes.RequestSoundboardSounds
2510
- d: GatewayRequestSoundboardSoundsData
2511
- }
2512
-
2513
- /**
2514
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
2515
- */
2516
- export interface GatewayRequestSoundboardSoundsData {
2517
- /**
2518
- * The ids of the guilds to get soundboard sounds for
2519
- */
2520
- guild_ids: Array<Snowflake>
2521
- }
2522
-
2523
- /**
2524
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
2525
- */
2526
- export interface GatewayVoiceStateUpdate {
2527
- op: GatewayOpcodes.VoiceStateUpdate
2528
- d: GatewayVoiceStateUpdateData
2529
- }
2530
-
2531
- /**
2532
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-voice-state}
2533
- */
2534
- export interface GatewayVoiceStateUpdateData {
2535
- /**
2536
- * ID of the guild
2537
- */
2538
- guild_id: Snowflake
2539
- /**
2540
- * ID of the voice channel client wants to join (`null` if disconnecting)
2541
- */
2542
- channel_id: Snowflake | null
2543
- /**
2544
- * Is the client muted
2545
- */
2546
- self_mute: boolean
2547
- /**
2548
- * Is the client deafened
2549
- */
2550
- self_deaf: boolean
2551
- }
2552
-
2553
- /**
2554
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
2555
- */
2556
- export interface GatewayUpdatePresence {
2557
- op: GatewayOpcodes.PresenceUpdate
2558
- d: GatewayPresenceUpdateData
2559
- }
2560
-
2561
- /**
2562
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-gateway-presence-update-structure}
2563
- */
2564
- export interface GatewayPresenceUpdateData {
2565
- /**
2566
- * Unix time (in milliseconds) of when the client went idle, or `null` if the client is not idle
2567
- */
2568
- since: number | null
2569
- /**
2570
- * The user's activities
2571
- *
2572
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object}
2573
- */
2574
- activities: Array<GatewayActivityUpdateData>
2575
- /**
2576
- * The user's new status
2577
- *
2578
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
2579
- */
2580
- status: PresenceUpdateStatus
2581
- /**
2582
- * Whether or not the client is afk
2583
- */
2584
- afk: boolean
2585
- }
2586
-
2587
- /**
2588
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure}
2589
- */
2590
- export type GatewayActivityUpdateData = Pick<
2591
- GatewayActivity,
2592
- "name" | "state" | "type" | "url"
2593
- >
2594
-
2595
- // #endregion Sendable Payloads
2596
-
2597
- // #region Shared
2598
- export interface _BasePayload {
2599
- /**
2600
- * Opcode for the payload
2601
- */
2602
- op: GatewayOpcodes
2603
- /**
2604
- * Event data
2605
- */
2606
- d?: unknown
2607
- /**
2608
- * Sequence number, used for resuming sessions and heartbeats
2609
- */
2610
- s: number
2611
- /**
2612
- * The event name for this payload
2613
- */
2614
- t?: string
2615
- }
2616
-
2617
- export type _NonDispatchPayload = Omit<_BasePayload, "s" | "t"> & {
2618
- t: null
2619
- s: null
2620
- }
2621
-
2622
- export interface _DataPayload<
2623
- Event extends GatewayDispatchEvents,
2624
- D = unknown,
2625
- > extends _BasePayload {
2626
- op: GatewayOpcodes.Dispatch
2627
- t: Event
2628
- d: D
2629
- }
2630
-
2631
- export type GatewayMessageReactionData<
2632
- E extends GatewayDispatchEvents,
2633
- O extends string = never,
2634
- > = _DataPayload<
2635
- E,
2636
- Omit<
2637
- {
2638
- /**
2639
- * The id of the user
2640
- */
2641
- user_id: Snowflake
2642
- /**
2643
- * The id of the channel
2644
- */
2645
- channel_id: Snowflake
2646
- /**
2647
- * The id of the message
2648
- */
2649
- message_id: Snowflake
2650
- /**
2651
- * The id of the guild
2652
- */
2653
- guild_id?: Snowflake
2654
- /**
2655
- * The member who reacted if this happened in a guild
2656
- *
2657
- * @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
2658
- */
2659
- member?: APIGuildMember
2660
- /**
2661
- * The emoji used to react
2662
- *
2663
- * @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object}
2664
- */
2665
- emoji: APIEmoji
2666
- /**
2667
- * The id of the user that posted the message that was reacted to
2668
- */
2669
- message_author_id?: Snowflake
2670
- /**
2671
- * True if this is a super-reaction
2672
- */
2673
- burst: boolean
2674
- /**
2675
- * Colors used for super-reaction animation in "#rrggbb" format
2676
- */
2677
- burst_colors: Array<string>
2678
- /**
2679
- * The type of reaction
2680
- */
2681
- type: ReactionType
2682
- },
2683
- O
2684
- >
2685
- >
2686
-
2687
- export interface GatewayMessageReactionRemoveData {
2688
- /**
2689
- * The id of the channel
2690
- */
2691
- channel_id: Snowflake
2692
- /**
2693
- * The id of the message
2694
- */
2695
- message_id: Snowflake
2696
- /**
2697
- * The id of the guild
2698
- */
2699
- guild_id?: Snowflake
2700
- }
2701
-
2702
- /**
2703
- * @see {@link https://discord.com/developers/docs/topics/gateway#get-gateway}
2704
- */
2705
- export interface APIGatewayInfo {
2706
- /**
2707
- * The WSS URL that can be used for connecting to the gateway
2708
- */
2709
- url: string
2710
- }
2711
-
2712
- /**
2713
- * @see {@link https://discord.com/developers/docs/topics/gateway#get-gateway-bot}
2714
- */
2715
- export interface APIGatewayBotInfo extends APIGatewayInfo {
2716
- /**
2717
- * The recommended number of shards to use when connecting
2718
- *
2719
- * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
2720
- */
2721
- shards: number
2722
- /**
2723
- * Information on the current session start limit
2724
- *
2725
- * @see {@link https://discord.com/developers/docs/topics/gateway#session-start-limit-object}
2726
- */
2727
- session_start_limit: APIGatewaySessionStartLimit
2728
- }
2729
-
2730
- /**
2731
- * @see {@link https://discord.com/developers/docs/topics/gateway#session-start-limit-object}
2732
- */
2733
- export interface APIGatewaySessionStartLimit {
2734
- /**
2735
- * The total number of session starts the current user is allowed
2736
- */
2737
- total: number
2738
- /**
2739
- * The remaining number of session starts the current user is allowed
2740
- */
2741
- remaining: number
2742
- /**
2743
- * The number of milliseconds after which the limit resets
2744
- */
2745
- reset_after: number
2746
- /**
2747
- * The number of identify requests allowed per 5 seconds
2748
- */
2749
- max_concurrency: number
2750
- }
2751
-
2752
- /**
2753
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
2754
- */
2755
- export interface GatewayPresenceUpdate {
2756
- /**
2757
- * The user presence is being updated for
2758
- *
2759
- * **The user object within this event can be partial, the only field which must be sent is the `id` field,
2760
- * everything else is optional.**
2761
- *
2762
- * @see {@link https://discord.com/developers/docs/resources/user#user-object}
2763
- */
2764
- user: Partial<APIUser> & Pick<APIUser, "id">
2765
- /**
2766
- * ID of the guild
2767
- */
2768
- guild_id: Snowflake
2769
- /**
2770
- * Either "idle", "dnd", "online", or "offline"
2771
- */
2772
- status?: PresenceUpdateReceiveStatus
2773
- /**
2774
- * User's current activities
2775
- *
2776
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object}
2777
- */
2778
- activities?: Array<GatewayActivity>
2779
- /**
2780
- * User's platform-dependent status
2781
- *
2782
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#client-status-object}
2783
- */
2784
- client_status?: GatewayPresenceClientStatus
2785
- }
2786
-
2787
- /**
2788
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
2789
- */
2790
- export enum PresenceUpdateStatus {
2791
- Online = "online",
2792
- DoNotDisturb = "dnd",
2793
- Idle = "idle",
2794
- /**
2795
- * Invisible and shown as offline
2796
- */
2797
- Invisible = "invisible",
2798
- Offline = "offline",
2799
- }
2800
-
2801
- export type PresenceUpdateReceiveStatus = Exclude<
2802
- PresenceUpdateStatus,
2803
- PresenceUpdateStatus.Invisible
2804
- >
2805
-
2806
- /**
2807
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#client-status-object}
2808
- */
2809
- export interface GatewayPresenceClientStatus {
2810
- /**
2811
- * The user's status set for an active desktop (Windows, Linux, Mac) application session
2812
- */
2813
- desktop?: PresenceUpdateReceiveStatus
2814
- /**
2815
- * The user's status set for an active mobile (iOS, Android) application session
2816
- */
2817
- mobile?: PresenceUpdateReceiveStatus
2818
- /**
2819
- * The user's status set for an active web (browser, bot account) application session
2820
- */
2821
- web?: PresenceUpdateReceiveStatus
2822
- }
2823
-
2824
- /**
2825
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure}
2826
- */
2827
- export interface GatewayActivity {
2828
- /**
2829
- * The activity's id
2830
- *
2831
- * @unstable
2832
- */
2833
- id: string
2834
- /**
2835
- * The activity's name
2836
- */
2837
- name: string
2838
- /**
2839
- * Activity type
2840
- *
2841
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types}
2842
- */
2843
- type: ActivityType
2844
- /**
2845
- * Stream url, is validated when type is `1`
2846
- */
2847
- url?: string | null
2848
- /**
2849
- * Unix timestamp of when the activity was added to the user's session
2850
- */
2851
- created_at: number
2852
- /**
2853
- * Unix timestamps for start and/or end of the game
2854
- */
2855
- timestamps?: GatewayActivityTimestamps
2856
- /**
2857
- * The Spotify song id
2858
- *
2859
- * @unstable
2860
- */
2861
- sync_id?: string
2862
- /**
2863
- * The platform this activity is being done on
2864
- *
2865
- * @unstable You can use {@link ActivityPlatform} as a stepping stone, but this might be inaccurate
2866
- */
2867
- platform?: string
2868
- /**
2869
- * Application id for the game
2870
- */
2871
- application_id?: Snowflake
2872
- /**
2873
- * What the player is currently doing
2874
- */
2875
- details?: string | null
2876
- /**
2877
- * The user's current party status, or the text used for a custom status
2878
- */
2879
- state?: string | null
2880
- /**
2881
- * The emoji used for a custom status
2882
- *
2883
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji}
2884
- */
2885
- emoji?: GatewayActivityEmoji
2886
- /**
2887
- * @unstable
2888
- */
2889
- session_id?: string
2890
- /**
2891
- * Information for the current party of the player
2892
- *
2893
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party}
2894
- */
2895
- party?: GatewayActivityParty
2896
- /**
2897
- * Images for the presence and their hover texts
2898
- *
2899
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets}
2900
- */
2901
- assets?: GatewayActivityAssets
2902
- /**
2903
- * Secrets for Rich Presence joining and spectating
2904
- *
2905
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets}
2906
- */
2907
- secrets?: GatewayActivitySecrets
2908
- /**
2909
- * Whether or not the activity is an instanced game session
2910
- */
2911
- instance?: boolean
2912
- /**
2913
- * Activity flags `OR`d together, describes what the payload includes
2914
- *
2915
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags}
2916
- * @see {@link https://en.wikipedia.org/wiki/Bit_field}
2917
- */
2918
- flags?: ActivityFlags
2919
- /**
2920
- * The custom buttons shown in the Rich Presence (max 2)
2921
- */
2922
- buttons?: Array<GatewayActivityButton> | Array<string>
2923
- }
2924
-
2925
- /**
2926
- * @unstable This enum is currently not documented by Discord but has known values which we will try to keep up to date.
2927
- * Values might be added or removed without a major version bump.
2928
- */
2929
- export enum ActivityPlatform {
2930
- Desktop = "desktop",
2931
- Xbox = "xbox",
2932
- Samsung = "samsung",
2933
- IOS = "ios",
2934
- Android = "android",
2935
- Embedded = "embedded",
2936
- PS4 = "ps4",
2937
- PS5 = "ps5",
2938
- }
2939
-
2940
- /**
2941
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types}
2942
- */
2943
- export enum ActivityType {
2944
- /**
2945
- * Playing \{game\}
2946
- */
2947
- Playing,
2948
- /**
2949
- * Streaming \{details\}
2950
- */
2951
- Streaming,
2952
- /**
2953
- * Listening to \{name\}
2954
- */
2955
- Listening,
2956
- /**
2957
- * Watching \{details\}
2958
- */
2959
- Watching,
2960
- /**
2961
- * \{emoji\} \{state\}
2962
- */
2963
- Custom,
2964
- /**
2965
- * Competing in \{name\}
2966
- */
2967
- Competing,
2968
- }
2969
-
2970
- /**
2971
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps}
2972
- */
2973
- export interface GatewayActivityTimestamps {
2974
- /**
2975
- * Unix time (in milliseconds) of when the activity started
2976
- */
2977
- start?: number
2978
- /**
2979
- * Unix time (in milliseconds) of when the activity ends
2980
- */
2981
- end?: number
2982
- }
2983
-
2984
- /**
2985
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji}
2986
- */
2987
- export type GatewayActivityEmoji = Partial<Pick<APIEmoji, "animated" | "id">> &
2988
- Pick<APIEmoji, "name">
2989
-
2990
- /**
2991
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party}
2992
- */
2993
- export interface GatewayActivityParty {
2994
- /**
2995
- * The id of the party
2996
- */
2997
- id?: string
2998
- /**
2999
- * Used to show the party's current and maximum size
3000
- */
3001
- size?: [current_size: number, max_size: number]
3002
- }
3003
-
3004
- /**
3005
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets}
3006
- */
3007
- export type GatewayActivityAssets = Partial<
3008
- Record<"large_image" | "large_text" | "small_image" | "small_text", string>
3009
- >
3010
-
3011
- /**
3012
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets}
3013
- */
3014
- export type GatewayActivitySecrets = Partial<
3015
- Record<"join" | "match" | "spectate", string>
3016
- >
3017
-
3018
- /**
3019
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags}
3020
- */
3021
- export enum ActivityFlags {
3022
- Instance = 1 << 0,
3023
- Join = 1 << 1,
3024
- Spectate = 1 << 2,
3025
- JoinRequest = 1 << 3,
3026
- Sync = 1 << 4,
3027
- Play = 1 << 5,
3028
- PartyPrivacyFriends = 1 << 6,
3029
- PartyPrivacyVoiceChannel = 1 << 7,
3030
- Embedded = 1 << 8,
3031
- }
3032
-
3033
- export interface GatewayActivityButton {
3034
- /**
3035
- * The text shown on the button (1-32 characters)
3036
- */
3037
- label: string
3038
- /**
3039
- * The url opened when clicking the button (1-512 characters)
3040
- */
3041
- url: string
3042
- }
3043
-
3044
- /**
3045
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields}
3046
- */
3047
- export interface GatewayThreadListSync {
3048
- /**
3049
- * ID of the guild
3050
- */
3051
- guild_id: Snowflake
3052
- /**
3053
- * The ids of all the parent channels whose threads are being synced, otherwise the entire guild
3054
- */
3055
- channel_ids?: Array<Snowflake>
3056
- /**
3057
- * Array of the synced threads
3058
- */
3059
- threads: Array<APIThreadChannel>
3060
- /**
3061
- * The member objects for the client user in each joined thread that was synced
3062
- */
3063
- members: Array<APIThreadMember>
3064
- }
3065
-
3066
- /**
3067
- * @see {@link https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields}
3068
- */
3069
- export interface GatewayThreadMembersUpdate {
3070
- /**
3071
- * The id of the thread for which members are being synced
3072
- */
3073
- id: Snowflake
3074
- /**
3075
- * The id of the guild that the thread is in
3076
- */
3077
- guild_id: Snowflake
3078
- /**
3079
- * The approximate member count of the thread, does not count above 50 even if there are more members
3080
- */
3081
- member_count: number
3082
- /**
3083
- * The members that were added to the thread
3084
- */
3085
- added_members?: Array<APIThreadMember>
3086
- /**
3087
- * The ids of the members that were removed from the thread
3088
- */
3089
- removed_member_ids?: Array<Snowflake>
3090
- }