Skip to content

Commit

Permalink
add APPLICATION_COMMAND events, will maybe add an ApplicationCommand …
Browse files Browse the repository at this point in the history
…class later
  • Loading branch information
JustCat80 committed Aug 20, 2021
1 parent a274d08 commit cbe1502
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@ declare namespace Eris {
(event: "guildUpdate", listener: (guild: Guild, oldGuild: OldGuild) => void): T;
(event: "hello", listener: (trace: string[], id: number) => void): T;
(event: "interactionCreate", listener: (interaction: PingInteraction | CommandInteraction | ComponentInteraction | UnknownInteraction) => void): T;
(event: "commandCreate", listener: (interaction: ApplicationCommand) => void): T;
(event: "commandUpdate", listener: (interaction: ApplicationCommand) => void): T;
(event: "commandDelete", listener: (interaction: ApplicationCommand) => void): T;
(event: "inviteCreate" | "inviteDelete", listener: (guild: Guild, invite: Invite) => void): T;
(event: "messageCreate", listener: (message: Message<PossiblyUncachedTextableChannel>) => void): T;
(event: "messageDelete" | "messageReactionRemoveAll", listener: (message: PossiblyUncachedMessage) => void): T;
Expand Down
27 changes: 27 additions & 0 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2087,6 +2087,33 @@ class Shard extends EventEmitter {
this.emit("interactionCreate", Interaction.from(packet.d, this.client));
break;
}
case "APPLICATION_COMMAND_CREATE": {
/**
* Fired when an application command is created (maybe, actually unsure)
* @event Client#commandCreate
* @prop {Object} command The application command that was created
*/
this.emit("commandCreate", packet.d);
break;
}
case "APPLICATION_COMMAND_UPDATE": {
/**
* Fired when an application command is updated (maybe, actually unsure)
* @event Client#commandUpdate
* @prop {Object} command The application command that was created
*/
this.emit("commandUpdate", packet.d);
break;
}
case "APPLICATION_COMMAND_DELETE": {
/**
* Fired when an application command is deleted (maybe, actually unsure)
* @event Client#commandDelete
* @prop {Object} command The application command that was created
*/
this.emit("commandDelete", packet.d);
break;
}
default: {
/**
* Fired when the shard encounters an unknown packet
Expand Down

0 comments on commit cbe1502

Please sign in to comment.