Skip to content

Commit

Permalink
feat(MessageTypes): add CONTEXT_MENU_COMMAND (23) (#6425)
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 committed Sep 3, 2021
1 parent 0646056 commit d81590d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/util/Constants.js
Expand Up @@ -376,6 +376,7 @@ exports.InviteScopes = [
* * APPLICATION_COMMAND
* * THREAD_STARTER_MESSAGE
* * GUILD_INVITE_REMINDER
* * CONTEXT_MENU_COMMAND
* @typedef {string} MessageType
* @see {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}
*/
Expand Down Expand Up @@ -403,17 +404,19 @@ exports.MessageTypes = [
'APPLICATION_COMMAND',
'THREAD_STARTER_MESSAGE',
'GUILD_INVITE_REMINDER',
'CONTEXT_MENU_COMMAND',
];

/**
* The types of messages that are `System`. The available types are `MessageTypes` excluding:
* * DEFAULT
* * REPLY
* * APPLICATION_COMMAND
* * CONTEXT_MENU_COMMAND
* @typedef {string} SystemMessageType
*/
exports.SystemMessageTypes = exports.MessageTypes.filter(
type => type && !['DEFAULT', 'REPLY', 'APPLICATION_COMMAND'].includes(type),
type => type && !['DEFAULT', 'REPLY', 'APPLICATION_COMMAND', 'CONTEXT_MENU_COMMAND'].includes(type),
);

/**
Expand Down
8 changes: 6 additions & 2 deletions typings/index.d.ts
Expand Up @@ -4379,7 +4379,8 @@ export type MessageType =
| 'REPLY'
| 'APPLICATION_COMMAND'
| 'THREAD_STARTER_MESSAGE'
| 'GUILD_INVITE_REMINDER';
| 'GUILD_INVITE_REMINDER'
| 'CONTEXT_MENU_COMMAND';

export type MFALevel = keyof typeof MFALevels;

Expand Down Expand Up @@ -4646,7 +4647,10 @@ export type SystemChannelFlagsString =

export type SystemChannelFlagsResolvable = BitFieldResolvable<SystemChannelFlagsString, number>;

export type SystemMessageType = Exclude<MessageType, 'DEFAULT' | 'REPLY' | 'APPLICATION_COMMAND'>;
export type SystemMessageType = Exclude<
MessageType,
'DEFAULT' | 'REPLY' | 'APPLICATION_COMMAND' | 'CONTEXT_MENU_COMMAND'
>;

export type StageChannelResolvable = StageChannel | Snowflake;

Expand Down

0 comments on commit d81590d

Please sign in to comment.