Skip to content

Commit

Permalink
feat: add new message types (abalabahaha#22)
Browse files Browse the repository at this point in the history
* feat: add new message types

currently won't apply any transformations to message content, as I don't know how the messages look like.

ref: discord/discord-api-docs@e9711be
ref: discord/discord-api-docs@83f6c85

* don't do anything special to the messages right now
  • Loading branch information
TTtie authored Jan 8, 2023
1 parent cf0a9f1 commit 651078b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2166,6 +2166,8 @@ declare namespace Dysnomia {
CONTEXT_MENU_COMMAND: 23;
AUTO_MODERATION_ACTION: 24;
ROLE_SUBSCRIPTION_PURCHASE: 25;
INTERACTION_PREMIUM_UPSELL: 26;
GUILD_APPLICATION_PREMIUM_SUBSCRIPTION: 32;
};
MembershipState: {
INVITED: 1;
Expand Down
4 changes: 3 additions & 1 deletion lib/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ module.exports.MessageTypes = {
GUILD_INVITE_REMINDER: 22,
CONTEXT_MENU_COMMAND: 23,
AUTO_MODERATION_ACTION: 24,
ROLE_SUBSCRIPTION_PURCHASE: 25
ROLE_SUBSCRIPTION_PURCHASE: 25,
INTERACTION_PREMIUM_UPSELL: 26,
GUILD_APPLICATION_PREMIUM_SUBSCRIPTION: 32
};

module.exports.MembershipState = {
Expand Down
9 changes: 9 additions & 0 deletions lib/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ class Message extends Base {
case MessageTypes.AUTO_MODERATION_ACTION: {
break;
}
case MessageTypes.ROLE_SUBSCRIPTION_PURCHASE: {
break;
}
case MessageTypes.INTERACTION_PREMIUM_UPSELL: {
break;
}
case MessageTypes.GUILD_APPLICATION_PREMIUM_SUBSCRIPTION: {
break;
}
default: {
this._client.emit("warn", `Unhandled MESSAGE_CREATE type: ${JSON.stringify(data, null, 2)}`);
break;
Expand Down

0 comments on commit 651078b

Please sign in to comment.