Skip to content

Commit

Permalink
fix: Remove DM channels from Client#messageDeleteBulk's types (#8460)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Aug 10, 2022
1 parent 0e2a095 commit 6c6fe74
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Expand Up @@ -33,7 +33,7 @@ class MessageDeleteBulkAction extends Action {
* Emitted whenever messages are deleted in bulk.
* @event Client#messageDeleteBulk
* @param {Collection<Snowflake, Message>} messages The deleted messages, mapped by their id
* @param {TextBasedChannels} channel The channel that the messages were deleted in
* @param {GuildTextBasedChannel} channel The channel that the messages were deleted in
*/
if (messages.size > 0) client.emit(Events.MessageBulkDelete, messages, channel);
return { messages };
Expand Down
12 changes: 9 additions & 3 deletions packages/discord.js/src/util/Constants.js
Expand Up @@ -53,13 +53,19 @@ exports.NonSystemMessageTypes = [
];

/**
* The channels that are text-based.
* * DMChannel
* The guild channels that are text-based.
* * TextChannel
* * NewsChannel
* * ThreadChannel
* * VoiceChannel
* @typedef {DMChannel|TextChannel|NewsChannel|ThreadChannel|VoiceChannel} TextBasedChannels
* @typedef {TextChannel|NewsChannel|ThreadChannel|VoiceChannel} GuildTextBasedChannel
*/

/**
* The channels that are text-based.
* * DMChannel
* * GuildTextBasedChannel
* @typedef {DMChannel|GuildTextBasedChannel} TextBasedChannels
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/discord.js/typings/index.d.ts
Expand Up @@ -4134,7 +4134,7 @@ export interface ClientEvents {
reactions: Collection<string | Snowflake, MessageReaction>,
];
messageReactionRemoveEmoji: [reaction: MessageReaction | PartialMessageReaction];
messageDeleteBulk: [messages: Collection<Snowflake, Message | PartialMessage>, channel: TextBasedChannel];
messageDeleteBulk: [messages: Collection<Snowflake, Message | PartialMessage>, channel: GuildTextBasedChannel];
messageReactionAdd: [reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser];
messageReactionRemove: [reaction: MessageReaction | PartialMessageReaction, user: User | PartialUser];
messageUpdate: [oldMessage: Message | PartialMessage, newMessage: Message | PartialMessage];
Expand Down

1 comment on commit 6c6fe74

@vercel
Copy link

@vercel vercel bot commented on 6c6fe74 Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.