disgroove 2.2.0-dev.15819eb → 2.2.0-dev.301452e

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.
@@ -107,7 +107,7 @@ class Shard {
107
107
  case "READY":
108
108
  {
109
109
  this.sessionId = packet.d.session_id;
110
- this.client.user = this.client.util.toCamelCase(packet.d.user);
110
+ this.client.user = this.client.util.userFromRaw(packet.d.user);
111
111
  this.client.guilds = new Map();
112
112
  this.client.application = packet.d.application;
113
113
  this.client.emit(constants_1.GatewayEvents.Ready);
@@ -117,126 +117,239 @@ class Shard {
117
117
  this.client.emit(constants_1.GatewayEvents.Resumed);
118
118
  break;
119
119
  case "APPLICATION_COMMAND_PERMISSIONS_UPDATE":
120
- this.client.emit(constants_1.GatewayEvents.ApplicationCommandPermissionsUpdate, this.client.util.toCamelCase(packet.d));
120
+ this.client.emit(constants_1.GatewayEvents.ApplicationCommandPermissionsUpdate, {
121
+ id: packet.d.id,
122
+ applicationId: packet.d.application_id,
123
+ guildId: packet.d.guild_id,
124
+ permissions: packet.d.permissions.map((permission) => ({
125
+ id: permission.id,
126
+ type: permission.type,
127
+ permission: permission.permission,
128
+ })),
129
+ });
121
130
  break;
122
131
  case "AUTO_MODERATION_RULE_CREATE":
123
- this.client.emit(constants_1.GatewayEvents.AutoModerationRuleCreate, this.client.util.toCamelCase(packet.d));
132
+ this.client.emit(constants_1.GatewayEvents.AutoModerationRuleCreate, this.client.util.autoModerationRuleFromRaw(packet.d));
124
133
  break;
125
134
  case "AUTO_MODERATION_RULE_UPDATE":
126
- this.client.emit(constants_1.GatewayEvents.AutoModerationRuleUpdate, this.client.util.toCamelCase(packet.d));
135
+ this.client.emit(constants_1.GatewayEvents.AutoModerationRuleUpdate, this.client.util.autoModerationRuleFromRaw(packet.d));
127
136
  break;
128
137
  case "AUTO_MODERATION_RULE_DELETE":
129
- this.client.emit(constants_1.GatewayEvents.AutoModerationRuleDelete, this.client.util.toCamelCase(packet.d));
138
+ this.client.emit(constants_1.GatewayEvents.AutoModerationRuleDelete, this.client.util.autoModerationRuleFromRaw(packet.d));
130
139
  break;
131
140
  case "AUTO_MODERATION_ACTION_EXECUTION":
132
- this.client.emit(constants_1.GatewayEvents.AutoModerationActionExecution, this.client.util.toCamelCase(packet.d));
141
+ this.client.emit(constants_1.GatewayEvents.AutoModerationActionExecution, {
142
+ guildId: packet.d.guild_id,
143
+ action: {
144
+ type: packet.d.action.type,
145
+ metadata: {
146
+ channelId: packet.d.action.metadata.channel_id,
147
+ durationSeconds: packet.d.action.metadata.duration_seconds,
148
+ customMessage: packet.d.action.metadata.custom_message,
149
+ },
150
+ },
151
+ ruleId: packet.d.rule_id,
152
+ ruleTriggerType: packet.d.rule_trigger_type,
153
+ userId: packet.d.user_id,
154
+ channelId: packet.d.channel_id,
155
+ messageId: packet.d.message_id,
156
+ alertSystemMessageId: packet.d.alert_system_message_id,
157
+ content: packet.d.content,
158
+ matchedKeyword: packet.d.matched_keyword,
159
+ matchedContent: packet.d.matched_content,
160
+ });
133
161
  break;
134
162
  case "CHANNEL_CREATE":
135
- this.client.emit(constants_1.GatewayEvents.ChannelCreate, this.client.util.toCamelCase(packet.d));
163
+ this.client.emit(constants_1.GatewayEvents.ChannelCreate, this.client.util.channelFromRaw(packet.d));
136
164
  break;
137
165
  case "CHANNEL_UPDATE":
138
- this.client.emit(constants_1.GatewayEvents.ChannelUpdate, this.client.util.toCamelCase(packet.d));
166
+ this.client.emit(constants_1.GatewayEvents.ChannelUpdate, this.client.util.channelFromRaw(packet.d));
139
167
  break;
140
168
  case "CHANNEL_DELETE":
141
- this.client.emit(constants_1.GatewayEvents.ChannelDelete, this.client.util.toCamelCase(packet.d));
169
+ this.client.emit(constants_1.GatewayEvents.ChannelDelete, this.client.util.channelFromRaw(packet.d));
142
170
  break;
143
171
  case "CHANNEL_PINS_UPDATE":
144
- this.client.emit(constants_1.GatewayEvents.ChannelPinsUpdate, this.client.util.toCamelCase(packet.d));
172
+ this.client.emit(constants_1.GatewayEvents.ChannelPinsUpdate, {
173
+ guildId: packet.d.guild_id,
174
+ channelId: packet.d.channel_id,
175
+ lastPinTimestamp: packet.d.last_pin_timestamp,
176
+ });
145
177
  break;
146
178
  case "THREAD_CREATE":
147
- this.client.emit(constants_1.GatewayEvents.ThreadCreate, this.client.util.toCamelCase(packet.d));
179
+ this.client.emit(constants_1.GatewayEvents.ThreadCreate, this.client.util.channelFromRaw(packet.d));
148
180
  break;
149
181
  case "THREAD_UPDATE":
150
- this.client.emit(constants_1.GatewayEvents.ThreadUpdate, this.client.util.toCamelCase(packet.d));
182
+ this.client.emit(constants_1.GatewayEvents.ThreadUpdate, this.client.util.channelFromRaw(packet.d));
151
183
  break;
152
184
  case "THREAD_DELETE":
153
- this.client.emit(constants_1.GatewayEvents.ThreadDelete, this.client.util.toCamelCase(packet.d));
185
+ this.client.emit(constants_1.GatewayEvents.ThreadDelete, this.client.util.channelFromRaw(packet.d));
154
186
  break;
155
187
  case "THREAD_LIST_SYNC":
156
- this.client.emit(constants_1.GatewayEvents.ThreadListSync, this.client.util.toCamelCase(packet.d));
188
+ this.client.emit(constants_1.GatewayEvents.ThreadListSync, {
189
+ guildId: packet.d.guild_id,
190
+ channelIds: packet.d.channel_ids,
191
+ threads: packet.d.threads.map((thread) => this.client.util.channelFromRaw(thread)),
192
+ members: packet.d.members.map((threadMember) => ({
193
+ id: threadMember.id,
194
+ userId: threadMember.user_id,
195
+ joinTimestamp: threadMember.join_timestamp,
196
+ flags: threadMember.flags,
197
+ member: threadMember.member !== undefined
198
+ ? this.client.util.guildMemberFromRaw(threadMember.member)
199
+ : undefined,
200
+ })),
201
+ });
157
202
  break;
158
203
  case "THREAD_MEMBER_UPDATE":
159
- this.client.emit(constants_1.GatewayEvents.ThreadMemberUpdate, this.client.util.toCamelCase(packet.d));
204
+ this.client.emit(constants_1.GatewayEvents.ThreadMemberUpdate, {
205
+ id: packet.d.id,
206
+ userId: packet.d.user_id,
207
+ joinTimestamp: packet.d.join_timestamp,
208
+ flags: packet.d.flags,
209
+ member: packet.d.member !== undefined
210
+ ? this.client.util.guildMemberFromRaw(packet.d.member)
211
+ : undefined,
212
+ guildId: packet.d.guild_id,
213
+ });
160
214
  break;
161
215
  case "THREAD_MEMBERS_UPDATE":
162
- this.client.emit(constants_1.GatewayEvents.ThreadMembersUpdate, this.client.util.toCamelCase(packet.d));
216
+ this.client.emit(constants_1.GatewayEvents.ThreadMembersUpdate, {
217
+ id: packet.d.id,
218
+ guildId: packet.d.guild_id,
219
+ memberCount: packet.d.member_count,
220
+ addedMembers: packet.d.members.map((threadMember) => ({
221
+ id: threadMember.id,
222
+ userId: threadMember.user_id,
223
+ joinTimestamp: threadMember.join_timestamp,
224
+ flags: threadMember.flags,
225
+ member: threadMember.member !== undefined
226
+ ? this.client.util.guildMemberFromRaw(threadMember.member)
227
+ : undefined,
228
+ })),
229
+ removedMemberIds: packet.d.removed_member_ids,
230
+ });
163
231
  break;
164
232
  case "ENTITLEMENT_CREATE":
165
- this.client.emit(constants_1.GatewayEvents.EntitlementCreate, this.client.util.toCamelCase(packet.d));
233
+ this.client.emit(constants_1.GatewayEvents.EntitlementCreate, this.client.util.entitlementFromRaw(packet.d));
166
234
  break;
167
235
  case "ENTITLEMENT_UPDATE":
168
- this.client.emit(constants_1.GatewayEvents.EntitlementUpdate, this.client.util.toCamelCase(packet.d));
236
+ this.client.emit(constants_1.GatewayEvents.EntitlementUpdate, this.client.util.entitlementFromRaw(packet.d));
169
237
  break;
170
238
  case "ENTITLEMENT_DELETE":
171
- this.client.emit(constants_1.GatewayEvents.EntitlementDelete, this.client.util.toCamelCase(packet.d));
239
+ this.client.emit(constants_1.GatewayEvents.EntitlementDelete, this.client.util.entitlementFromRaw(packet.d));
172
240
  break;
173
241
  case "GUILD_CREATE":
174
242
  {
175
243
  this.client.guildShardMap[packet.d.id] = this.id;
176
- this.client.guilds.set(packet.d.id, this.client.util.toCamelCase(packet.d));
177
- this.client.emit(constants_1.GatewayEvents.GuildCreate, this.client.util.toCamelCase(packet.d));
244
+ this.client.guilds.set(packet.d.id, this.client.util.guildFromRaw(packet.d));
245
+ this.client.emit(constants_1.GatewayEvents.GuildCreate, this.client.util.guildFromRaw(packet.d));
178
246
  }
179
247
  break;
180
248
  case "GUILD_UPDATE":
181
249
  {
182
- this.client.guilds.set(packet.d.id, this.client.util.toCamelCase(packet.d));
183
- this.client.emit(constants_1.GatewayEvents.GuildUpdate, this.client.util.toCamelCase(packet.d));
250
+ this.client.guilds.set(packet.d.id, this.client.util.guildFromRaw(packet.d));
251
+ this.client.emit(constants_1.GatewayEvents.GuildUpdate, this.client.util.guildFromRaw(packet.d));
184
252
  }
185
253
  break;
186
254
  case "GUILD_DELETE":
187
255
  {
188
256
  delete this.client.guildShardMap[packet.d.id];
189
257
  this.client.guilds.delete(packet.d.id);
190
- this.client.emit(constants_1.GatewayEvents.GuildDelete, this.client.util.toCamelCase(packet.d));
258
+ this.client.emit(constants_1.GatewayEvents.GuildDelete, {
259
+ id: packet.d.id,
260
+ unavailable: packet.d.unavailable,
261
+ });
191
262
  }
192
263
  break;
193
264
  case "GUILD_AUDIT_LOG_ENTRY_CREATE":
194
- this.client.emit(constants_1.GatewayEvents.GuildAuditLogEntryCreate, this.client.util.toCamelCase(packet.d));
265
+ this.client.emit(constants_1.GatewayEvents.GuildAuditLogEntryCreate, {
266
+ ...this.client.util.auditLogEntryFromRaw(packet.d),
267
+ guildId: packet.d.guild_id,
268
+ });
195
269
  break;
196
270
  case "GUILD_BAN_ADD":
197
- this.client.emit(constants_1.GatewayEvents.GuildBanAdd, this.client.util.toCamelCase(packet.d));
271
+ this.client.emit(constants_1.GatewayEvents.GuildBanAdd, {
272
+ guildId: packet.d.guild_id,
273
+ user: this.client.util.userFromRaw(packet.d.user),
274
+ });
198
275
  break;
199
276
  case "GUILD_BAN_REMOVE":
200
- this.client.emit(constants_1.GatewayEvents.GuildBanRemove, this.client.util.toCamelCase(packet.d));
277
+ this.client.emit(constants_1.GatewayEvents.GuildBanRemove, {
278
+ guildId: packet.d.guild_id,
279
+ user: this.client.util.userFromRaw(packet.d.user),
280
+ });
201
281
  break;
202
282
  case "GUILD_EMOJIS_UPDATE":
203
- this.client.emit(constants_1.GatewayEvents.GuildEmojisUpdate, packet.d.emojis.map((emoji) => this.client.util.toCamelCase(emoji)), packet.d.guild_id);
283
+ this.client.emit(constants_1.GatewayEvents.GuildEmojisUpdate, packet.d.emojis.map((emoji) => this.client.util.emojiFromRaw(emoji)), packet.d.guild_id);
204
284
  break;
205
285
  case "GUILD_STICKERS_UPDATE":
206
- this.client.emit(constants_1.GatewayEvents.GuildStickersUpdate, packet.d.stickers.map((sticker) => this.client.util.toCamelCase(sticker)), packet.d.guild_id);
286
+ this.client.emit(constants_1.GatewayEvents.GuildStickersUpdate, packet.d.stickers.map((sticker) => this.client.util.stickerFromRaw(sticker)), packet.d.guild_id);
207
287
  break;
208
288
  case "GUILD_INTEGRATIONS_UPDATE":
209
289
  this.client.emit(constants_1.GatewayEvents.GuildIntegrationsUpdate, packet.d.guild_id);
210
290
  break;
211
291
  case "GUILD_MEMBER_ADD":
212
- this.client.emit(constants_1.GatewayEvents.GuildMemberAdd, this.client.util.toCamelCase(packet.d));
292
+ this.client.emit(constants_1.GatewayEvents.GuildMemberAdd, {
293
+ ...this.client.util.guildMemberFromRaw(packet.d),
294
+ guildId: packet.d.guild_id,
295
+ });
213
296
  break;
214
297
  case "GUILD_MEMBER_REMOVE":
215
- this.client.emit(constants_1.GatewayEvents.GuildMemberRemove, this.client.util.toCamelCase(packet.d));
298
+ this.client.emit(constants_1.GatewayEvents.GuildMemberRemove, {
299
+ guildId: packet.d.guild_id,
300
+ user: this.client.util.userFromRaw(packet.d.user),
301
+ });
216
302
  break;
217
303
  case "GUILD_MEMBER_UPDATE":
218
- this.client.emit(constants_1.GatewayEvents.GuildMemberUpdate, this.client.util.toCamelCase(packet.d));
304
+ this.client.emit(constants_1.GatewayEvents.GuildMemberUpdate, {
305
+ guildId: packet.d.guild_id,
306
+ roles: packet.d.roles,
307
+ user: this.client.util.userFromRaw(packet.d.user),
308
+ nick: packet.d.nick,
309
+ avatar: packet.d.avatar,
310
+ joinedAt: packet.d.joined_at,
311
+ premiumSince: packet.d.premium_since,
312
+ deaf: packet.d.deaf,
313
+ mute: packet.d.mute,
314
+ pending: packet.d.pending,
315
+ communicationDisabledUntil: packet.d.communication_disabled_until,
316
+ flags: packet.d.flags,
317
+ avatarDecorationData: packet.d.avatar_decoration_data !== undefined
318
+ ? {
319
+ asset: packet.d.asset,
320
+ skuId: packet.d.sku_id,
321
+ }
322
+ : undefined,
323
+ });
219
324
  break;
220
325
  case "GUILD_MEMBERS_CHUNK":
221
- this.client.emit(constants_1.GatewayEvents.GuildMembersChunk, this.client.util.toCamelCase(packet.d));
326
+ this.client.emit(constants_1.GatewayEvents.GuildMembersChunk, {
327
+ guildId: packet.d.guild_id,
328
+ members: packet.d.members.map((guildMember) => this.client.util.guildMemberFromRaw(guildMember)),
329
+ chunkIndex: packet.d.chunk_index,
330
+ chunkCount: packet.d.chunk_count,
331
+ notFound: packet.d.not_found,
332
+ presences: packet.d.presences?.map((presence) => this.client.util.presenceFromRaw(presence)),
333
+ nonce: packet.d.nonce,
334
+ });
222
335
  break;
223
336
  case "GUILD_ROLE_CREATE":
224
- this.client.emit(constants_1.GatewayEvents.GuildRoleCreate, this.client.util.toCamelCase(packet.d.role), packet.d.guild_id);
337
+ this.client.emit(constants_1.GatewayEvents.GuildRoleCreate, this.client.util.roleFromRaw(packet.d.role), packet.d.guild_id);
225
338
  break;
226
339
  case "GUILD_ROLE_UPDATE":
227
- this.client.emit(constants_1.GatewayEvents.GuildRoleUpdate, this.client.util.toCamelCase(packet.d.role), packet.d.guild_id);
340
+ this.client.emit(constants_1.GatewayEvents.GuildRoleUpdate, this.client.util.roleFromRaw(packet.d.role), packet.d.guild_id);
228
341
  break;
229
342
  case "GUILD_ROLE_DELETE":
230
343
  this.client.emit(constants_1.GatewayEvents.GuildRoleDelete, packet.d.role_id, packet.d.guild_id);
231
344
  break;
232
345
  case "GUILD_SCHEDULED_EVENT_CREATE":
233
- this.client.emit(constants_1.GatewayEvents.GuildScheduledEventCreate, this.client.util.toCamelCase(packet.d));
346
+ this.client.emit(constants_1.GatewayEvents.GuildScheduledEventCreate, this.client.util.guildScheduledEventFromRaw(packet.d));
234
347
  break;
235
348
  case "GUILD_SCHEDULED_EVENT_UPDATE":
236
- this.client.emit(constants_1.GatewayEvents.GuildScheduledEventUpdate, this.client.util.toCamelCase(packet.d));
349
+ this.client.emit(constants_1.GatewayEvents.GuildScheduledEventUpdate, this.client.util.guildScheduledEventFromRaw(packet.d));
237
350
  break;
238
351
  case "GUILD_SCHEDULED_EVENT_DELETE":
239
- this.client.emit(constants_1.GatewayEvents.GuildScheduledEventDelete, this.client.util.toCamelCase(packet.d));
352
+ this.client.emit(constants_1.GatewayEvents.GuildScheduledEventDelete, this.client.util.guildScheduledEventFromRaw(packet.d));
240
353
  break;
241
354
  case "GUILD_SCHEDULED_EVENT_USER_ADD":
242
355
  this.client.emit(constants_1.GatewayEvents.GuildScheduledEventUserAdd, packet.d.user_id, packet.d.guild_scheduled_event_id, packet.d.guild_id);
@@ -245,79 +358,181 @@ class Shard {
245
358
  this.client.emit(constants_1.GatewayEvents.GuildScheduledEventUserRemove, packet.d.user_id, packet.d.guild_scheduled_event_id, packet.d.guild_id);
246
359
  break;
247
360
  case "INTEGRATION_CREATE":
248
- this.client.emit(constants_1.GatewayEvents.IntegrationCreate, this.client.util.toCamelCase(packet.d));
361
+ this.client.emit(constants_1.GatewayEvents.IntegrationCreate, {
362
+ ...this.client.util.integrationFromRaw(packet.d),
363
+ guildId: packet.d.guild_id,
364
+ });
249
365
  break;
250
366
  case "INTEGRATION_UPDATE":
251
- this.client.emit(constants_1.GatewayEvents.IntegrationUpdate, this.client.util.toCamelCase(packet.d));
367
+ this.client.emit(constants_1.GatewayEvents.IntegrationUpdate, {
368
+ ...this.client.util.integrationFromRaw(packet.d),
369
+ guildId: packet.d.guild_id,
370
+ });
252
371
  break;
253
372
  case "INTEGRATION_DELETE":
254
- this.client.emit(constants_1.GatewayEvents.IntegrationDelete, this.client.util.toCamelCase(packet.d));
373
+ this.client.emit(constants_1.GatewayEvents.IntegrationDelete, {
374
+ id: packet.d.id,
375
+ guildId: packet.d.guild_id,
376
+ applicationId: packet.d.application_id,
377
+ });
255
378
  break;
256
379
  case "INTERACTION_CREATE":
257
- this.client.emit(constants_1.GatewayEvents.InteractionCreate, this.client.util.toCamelCase(packet.d));
380
+ this.client.emit(constants_1.GatewayEvents.InteractionCreate, this.client.util.interactionFromRaw(packet.d));
258
381
  break;
259
382
  case "INVITE_CREATE":
260
- this.client.emit(constants_1.GatewayEvents.InviteCreate, this.client.util.toCamelCase(packet.d));
383
+ this.client.emit(constants_1.GatewayEvents.InviteCreate, {
384
+ channelId: packet.d.channel_id,
385
+ code: packet.d.code,
386
+ createdAt: packet.d.created_at,
387
+ guildId: packet.d.guild_id,
388
+ inviter: packet.d.inviter !== undefined
389
+ ? this.client.util.userFromRaw(packet.d.inviter)
390
+ : undefined,
391
+ maxAge: packet.d.max_age,
392
+ maxUses: packet.d.max_uses,
393
+ targetType: packet.d.target_type,
394
+ targetUser: packet.d.target_user !== undefined
395
+ ? this.client.util.userFromRaw(packet.d.target_user)
396
+ : undefined,
397
+ targetApplication: packet.d.target_application !== undefined
398
+ ? this.client.util.applicationFromRaw(packet.d.target_application)
399
+ : undefined,
400
+ temporary: packet.d.temporary,
401
+ uses: packet.d.uses,
402
+ });
261
403
  break;
262
404
  case "INVITE_DELETE":
263
- this.client.emit(constants_1.GatewayEvents.InviteDelete, this.client.util.toCamelCase(packet.d));
405
+ this.client.emit(constants_1.GatewayEvents.InviteDelete, {
406
+ channelId: packet.d.channel_id,
407
+ guildId: packet.d.guild_id,
408
+ code: packet.d.code,
409
+ });
264
410
  break;
265
411
  case "MESSAGE_CREATE":
266
- this.client.emit(constants_1.GatewayEvents.MessageCreate, this.client.util.toCamelCase(packet.d));
412
+ this.client.emit(constants_1.GatewayEvents.MessageCreate, {
413
+ ...this.client.util.messageFromRaw(packet.d),
414
+ guildId: packet.d.guild_id,
415
+ member: packet.d.member !== undefined
416
+ ? this.client.util.guildMemberFromRaw(packet.d.member)
417
+ : undefined,
418
+ mentions: packet.d.mentions.map((mention) => this.client.util.userFromRaw(mention)),
419
+ });
267
420
  break;
268
421
  case "MESSAGE_UPDATE":
269
- this.client.emit(constants_1.GatewayEvents.MessageUpdate, this.client.util.toCamelCase(packet.d));
422
+ this.client.emit(constants_1.GatewayEvents.MessageUpdate, this.client.util.messageFromRaw(packet.d));
270
423
  break;
271
424
  case "MESSAGE_DELETE":
272
- this.client.emit(constants_1.GatewayEvents.MessageDelete, this.client.util.toCamelCase(packet.d));
425
+ this.client.emit(constants_1.GatewayEvents.MessageDelete, {
426
+ id: packet.d.id,
427
+ channelId: packet.d.channel_id,
428
+ guildId: packet.d.guild_id,
429
+ });
273
430
  break;
274
431
  case "MESSAGE_DELETE_BULK":
275
- this.client.emit(constants_1.GatewayEvents.MessageDeleteBulk, this.client.util.toCamelCase(packet.d));
432
+ this.client.emit(constants_1.GatewayEvents.MessageDeleteBulk, {
433
+ ids: packet.d.ids,
434
+ channelId: packet.d.channel_id,
435
+ guildId: packet.d.guild_id,
436
+ });
276
437
  break;
277
438
  case "MESSAGE_REACTION_ADD":
278
- this.client.emit(constants_1.GatewayEvents.MessageReactionAdd, this.client.util.toCamelCase(packet.d));
439
+ this.client.emit(constants_1.GatewayEvents.MessageReactionAdd, {
440
+ userId: packet.d.user_id,
441
+ channelId: packet.d.user_id,
442
+ messageId: packet.d.user_id,
443
+ guildId: packet.d.user_id,
444
+ member: packet.d.member !== undefined
445
+ ? this.client.util.guildMemberFromRaw(packet.d.member)
446
+ : undefined,
447
+ emoji: this.client.util.emojiFromRaw(packet.d.emoji),
448
+ messageAuthorId: packet.d.message_author_id,
449
+ burst: packet.d.burst,
450
+ burstColors: packet.d.burst_colors,
451
+ type: packet.d.type,
452
+ });
279
453
  break;
280
454
  case "MESSAGE_REACTION_REMOVE":
281
- this.client.emit(constants_1.GatewayEvents.MessageReactionRemove, this.client.util.toCamelCase(packet.d));
455
+ this.client.emit(constants_1.GatewayEvents.MessageReactionRemove, {
456
+ userId: packet.d.user_id,
457
+ channelId: packet.d.user_id,
458
+ messageId: packet.d.user_id,
459
+ guildId: packet.d.user_id,
460
+ emoji: this.client.util.emojiFromRaw(packet.d.emoji),
461
+ burst: packet.d.burst,
462
+ type: packet.d.type,
463
+ });
282
464
  break;
283
465
  case "MESSAGE_REACTION_REMOVE_ALL":
284
- this.client.emit(constants_1.GatewayEvents.MessageReactionRemoveAll, this.client.util.toCamelCase(packet.d));
466
+ this.client.emit(constants_1.GatewayEvents.MessageReactionRemoveAll, {
467
+ channelId: packet.d.channel_id,
468
+ messageId: packet.d.message_id,
469
+ guildId: packet.d.guild_id,
470
+ });
285
471
  break;
286
472
  case "MESSAGE_REACTION_REMOVE_EMOJI":
287
- this.client.emit(constants_1.GatewayEvents.MessageReactionRemoveEmoji, this.client.util.toCamelCase(packet.d));
473
+ this.client.emit(constants_1.GatewayEvents.MessageReactionRemoveEmoji, {
474
+ channelId: packet.d.channel_id,
475
+ guildId: packet.d.guild_id,
476
+ messageId: packet.d.message_id,
477
+ emoji: this.client.util.emojiFromRaw(packet.d.emoji),
478
+ });
288
479
  break;
289
480
  case "PRESENCE_UPDATE":
290
- this.client.emit(constants_1.GatewayEvents.PresenceUpdate, this.client.util.toCamelCase(packet.d));
481
+ this.client.emit(constants_1.GatewayEvents.PresenceUpdate, this.client.util.presenceFromRaw(packet.d));
291
482
  break;
292
483
  case "STAGE_INSTANCE_CREATE":
293
- this.client.emit(constants_1.GatewayEvents.StageInstanceCreate, this.client.util.toCamelCase(packet.d));
484
+ this.client.emit(constants_1.GatewayEvents.StageInstanceCreate, this.client.util.stageInstanceFromRaw(packet.d));
294
485
  break;
295
486
  case "STAGE_INSTANCE_UPDATE":
296
- this.client.emit(constants_1.GatewayEvents.StageInstanceUpdate, this.client.util.toCamelCase(packet.d));
487
+ this.client.emit(constants_1.GatewayEvents.StageInstanceUpdate, this.client.util.stageInstanceFromRaw(packet.d));
297
488
  break;
298
489
  case "STAGE_INSTANCE_DELETE":
299
- this.client.emit(constants_1.GatewayEvents.StageInstanceDelete, this.client.util.toCamelCase(packet.d));
490
+ this.client.emit(constants_1.GatewayEvents.StageInstanceDelete, this.client.util.stageInstanceFromRaw(packet.d));
300
491
  break;
301
492
  case "TYPING_START":
302
- this.client.emit(constants_1.GatewayEvents.TypingStart, this.client.util.toCamelCase(packet.d));
493
+ this.client.emit(constants_1.GatewayEvents.TypingStart, {
494
+ channelId: packet.d.channel_id,
495
+ guildId: packet.d.guild_id,
496
+ userId: packet.d.user_id,
497
+ timestamp: packet.d.timestamp,
498
+ member: packet.d.member !== undefined
499
+ ? this.client.util.guildMemberFromRaw(packet.d.member)
500
+ : undefined,
501
+ });
303
502
  break;
304
503
  case "USER_UPDATE":
305
- this.client.emit(constants_1.GatewayEvents.UserUpdate, this.client.util.toCamelCase(packet.d));
504
+ this.client.emit(constants_1.GatewayEvents.UserUpdate, this.client.util.userFromRaw(packet.d));
306
505
  break;
307
506
  case "VOICE_STATE_UPDATE":
308
- this.client.emit(constants_1.GatewayEvents.VoiceStateUpdate, this.client.util.toCamelCase(packet.d));
507
+ this.client.emit(constants_1.GatewayEvents.VoiceStateUpdate, this.client.util.voiceStateFromRaw(packet.d));
309
508
  break;
310
509
  case "VOICE_SERVER_UPDATE":
311
- this.client.emit(constants_1.GatewayEvents.VoiceServerUpdate, this.client.util.toCamelCase(packet.d));
510
+ this.client.emit(constants_1.GatewayEvents.VoiceServerUpdate, {
511
+ token: packet.d.token,
512
+ guildId: packet.d.guild_id,
513
+ endpoint: packet.d.endpoint,
514
+ });
312
515
  break;
313
516
  case "WEBHOOKS_UPDATE":
314
517
  this.client.emit(constants_1.GatewayEvents.WebhooksUpdate, packet.d.channel_id, packet.d.guild_id);
315
518
  break;
316
519
  case "MESSAGE_POLL_VOTE_ADD":
317
- this.client.emit(constants_1.GatewayEvents.MessagePollVoteAdd, this.client.util.toCamelCase(packet.d));
520
+ this.client.emit(constants_1.GatewayEvents.MessagePollVoteAdd, {
521
+ userId: packet.d.user_id,
522
+ channelId: packet.d.channel_id,
523
+ messageId: packet.d.message_id,
524
+ guildId: packet.d.guild_id,
525
+ answerId: packet.d.answer_id,
526
+ });
318
527
  break;
319
528
  case "MESSAGE_POLL_VOTE_REMOVE":
320
- this.client.emit(constants_1.GatewayEvents.MessagePollVoteRemove, this.client.util.toCamelCase(packet.d));
529
+ this.client.emit(constants_1.GatewayEvents.MessagePollVoteRemove, {
530
+ userId: packet.d.user_id,
531
+ channelId: packet.d.channel_id,
532
+ messageId: packet.d.message_id,
533
+ guildId: packet.d.guild_id,
534
+ answerId: packet.d.answer_id,
535
+ });
321
536
  break;
322
537
  }
323
538
  }
@@ -1,5 +1,30 @@
1
1
  export * from "./gateway";
2
2
  export * from "./rest";
3
+ export * from "./types/application-command";
4
+ export * from "./types/application-role-connection-metadata";
5
+ export * from "./types/application";
6
+ export * from "./types/audit-log";
7
+ export * from "./types/auto-moderation";
8
+ export * from "./types/channel";
9
+ export * from "./types/common";
10
+ export * from "./types/emoji";
11
+ export * from "./types/entitlements";
12
+ export * from "./types/gateway-events";
13
+ export * from "./types/guild-scheduled-event";
14
+ export * from "./types/guild-template";
15
+ export * from "./types/guild";
16
+ export * from "./types/interaction";
17
+ export * from "./types/invite";
18
+ export * from "./types/message-components";
19
+ export * from "./types/poll";
20
+ export * from "./types/role";
21
+ export * from "./types/sku";
22
+ export * from "./types/stage-instance";
23
+ export * from "./types/sticker";
24
+ export * from "./types/team";
25
+ export * from "./types/user";
26
+ export * from "./types/voice";
27
+ export * from "./types/webhook";
3
28
  export * from "./utils";
4
29
  export * from "./Client";
5
30
  export * from "./constants";
package/dist/lib/index.js CHANGED
@@ -16,6 +16,31 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./gateway"), exports);
18
18
  __exportStar(require("./rest"), exports);
19
+ __exportStar(require("./types/application-command"), exports);
20
+ __exportStar(require("./types/application-role-connection-metadata"), exports);
21
+ __exportStar(require("./types/application"), exports);
22
+ __exportStar(require("./types/audit-log"), exports);
23
+ __exportStar(require("./types/auto-moderation"), exports);
24
+ __exportStar(require("./types/channel"), exports);
25
+ __exportStar(require("./types/common"), exports);
26
+ __exportStar(require("./types/emoji"), exports);
27
+ __exportStar(require("./types/entitlements"), exports);
28
+ __exportStar(require("./types/gateway-events"), exports);
29
+ __exportStar(require("./types/guild-scheduled-event"), exports);
30
+ __exportStar(require("./types/guild-template"), exports);
31
+ __exportStar(require("./types/guild"), exports);
32
+ __exportStar(require("./types/interaction"), exports);
33
+ __exportStar(require("./types/invite"), exports);
34
+ __exportStar(require("./types/message-components"), exports);
35
+ __exportStar(require("./types/poll"), exports);
36
+ __exportStar(require("./types/role"), exports);
37
+ __exportStar(require("./types/sku"), exports);
38
+ __exportStar(require("./types/stage-instance"), exports);
39
+ __exportStar(require("./types/sticker"), exports);
40
+ __exportStar(require("./types/team"), exports);
41
+ __exportStar(require("./types/user"), exports);
42
+ __exportStar(require("./types/voice"), exports);
43
+ __exportStar(require("./types/webhook"), exports);
19
44
  __exportStar(require("./utils"), exports);
20
45
  __exportStar(require("./Client"), exports);
21
46
  __exportStar(require("./constants"), exports);
@@ -105,76 +105,3 @@ export interface ApplicationCommandPermission {
105
105
  type: ApplicationCommandPermissionType;
106
106
  permission: boolean;
107
107
  }
108
- export interface CreateGlobalApplicationCommandParams {
109
- name: string;
110
- nameLocalizations?: LocaleMap | null;
111
- description?: string;
112
- descriptionLocalizations?: LocaleMap | null;
113
- options?: Array<ApplicationCommandOption>;
114
- defaultMemberPermissions?: string | null;
115
- dmPermission?: boolean;
116
- defaultPermission?: boolean | null;
117
- type?: ApplicationCommandTypes;
118
- nsfw?: boolean;
119
- }
120
- export interface EditGlobalApplicationCommandParams {
121
- name?: string;
122
- nameLocalizations?: LocaleMap | null;
123
- description?: string;
124
- descriptionLocalizations?: LocaleMap | null;
125
- options?: Array<ApplicationCommandOption>;
126
- defaultMemberPermissions?: string | null;
127
- defaultPermission?: boolean | null;
128
- dmPermission?: boolean;
129
- nsfw?: boolean;
130
- }
131
- export type BulkEditGlobalApplicationCommandsParams = Array<{
132
- id?: snowflake;
133
- name: string;
134
- nameLocalizations?: LocaleMap | null;
135
- description?: string;
136
- descriptionLocalizations?: LocaleMap | null;
137
- options?: Array<ApplicationCommandOption>;
138
- defaultMemberPermissions?: string | null;
139
- dmPermission?: boolean;
140
- defaultPermission?: boolean | null;
141
- type?: ApplicationCommandTypes;
142
- nsfw?: boolean;
143
- }>;
144
- export interface CreateGuildApplicationCommandParams {
145
- name: string;
146
- nameLocalizations?: LocaleMap | null;
147
- description?: string;
148
- descriptionLocalizations?: LocaleMap | null;
149
- options?: Array<ApplicationCommandOption>;
150
- defaultMemberPermissions?: string | null;
151
- defaultPermission?: boolean | null;
152
- type?: ApplicationCommandTypes;
153
- nsfw?: boolean;
154
- }
155
- export interface EditGuildApplicationCommandParams {
156
- name?: string;
157
- nameLocalizations?: LocaleMap | null;
158
- description?: string;
159
- descriptionLocalizations?: LocaleMap | null;
160
- options?: Array<ApplicationCommandOption>;
161
- defaultMemberPermissions?: string | null;
162
- defaultPermission?: boolean | null;
163
- nsfw?: boolean;
164
- }
165
- export type BulkEditGuildApplicationCommandsParams = Array<{
166
- id?: snowflake;
167
- name: string;
168
- nameLocalizations?: LocaleMap | null;
169
- description?: string;
170
- descriptionLocalizations?: LocaleMap | null;
171
- options?: Array<ApplicationCommandOption>;
172
- defaultMemberPermissions?: string | null;
173
- dmPermission?: boolean;
174
- defaultPermission?: boolean | null;
175
- type: ApplicationCommandTypes;
176
- nsfw?: boolean;
177
- }>;
178
- export interface EditApplicationCommandPermissionsParams {
179
- permissions: Array<GuildApplicationCommandPermissions>;
180
- }
@@ -76,15 +76,3 @@ export interface InstallParams {
76
76
  scopes: Array<OAuth2Scopes>;
77
77
  permissions: string;
78
78
  }
79
- export interface EditCurrentApplicationParams {
80
- customInstallUrl?: string;
81
- description?: string;
82
- roleConnectionsVerificationUrl?: string;
83
- installParams?: InstallParams;
84
- integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
85
- flags?: ApplicationFlags;
86
- icon?: string;
87
- coverImage?: string;
88
- interactionsEndpointUrl?: string;
89
- tags?: Array<string>;
90
- }