2021-04-04 05:42:15 +00:00
|
|
|
import type { GatewayEventHandler } from '../mod.ts'
|
2021-01-20 10:05:15 +00:00
|
|
|
import {
|
|
|
|
GatewayEvents,
|
|
|
|
MessageDeletePayload,
|
|
|
|
TypingStartGuildData
|
|
|
|
} from '../../types/gateway.ts'
|
2020-12-02 12:29:52 +00:00
|
|
|
import { channelCreate } from './channelCreate.ts'
|
|
|
|
import { channelDelete } from './channelDelete.ts'
|
|
|
|
import { channelUpdate } from './channelUpdate.ts'
|
|
|
|
import { channelPinsUpdate } from './channelPinsUpdate.ts'
|
|
|
|
import { guildCreate } from './guildCreate.ts'
|
2020-12-03 05:28:20 +00:00
|
|
|
import { guildDelete } from './guildDelete.ts'
|
2020-12-02 12:29:52 +00:00
|
|
|
import { guildUpdate } from './guildUpdate.ts'
|
|
|
|
import { guildBanAdd } from './guildBanAdd.ts'
|
|
|
|
import { ready } from './ready.ts'
|
|
|
|
import { guildBanRemove } from './guildBanRemove.ts'
|
|
|
|
import { messageCreate } from './messageCreate.ts'
|
|
|
|
import { resume } from './resume.ts'
|
|
|
|
import { reconnect } from './reconnect.ts'
|
|
|
|
import { messageDelete } from './messageDelete.ts'
|
|
|
|
import { messageUpdate } from './messageUpdate.ts'
|
|
|
|
import { guildEmojiUpdate } from './guildEmojiUpdate.ts'
|
|
|
|
import { guildMemberAdd } from './guildMemberAdd.ts'
|
|
|
|
import { guildMemberRemove } from './guildMemberRemove.ts'
|
|
|
|
import { guildMemberUpdate } from './guildMemberUpdate.ts'
|
|
|
|
import { guildRoleCreate } from './guildRoleCreate.ts'
|
|
|
|
import { guildRoleDelete } from './guildRoleDelete.ts'
|
|
|
|
import { guildRoleUpdate } from './guildRoleUpdate.ts'
|
|
|
|
import { guildIntegrationsUpdate } from './guildIntegrationsUpdate.ts'
|
|
|
|
import { webhooksUpdate } from './webhooksUpdate.ts'
|
|
|
|
import { messageDeleteBulk } from './messageDeleteBulk.ts'
|
|
|
|
import { userUpdate } from './userUpdate.ts'
|
|
|
|
import { typingStart } from './typingStart.ts'
|
2021-03-19 15:39:14 +00:00
|
|
|
import { TextChannel } from '../../structures/textChannel.ts'
|
|
|
|
import { GuildTextBasedChannel } from '../../structures/guildTextChannel.ts'
|
2020-12-02 12:29:52 +00:00
|
|
|
import { Guild } from '../../structures/guild.ts'
|
|
|
|
import { User } from '../../structures/user.ts'
|
|
|
|
import { Emoji } from '../../structures/emoji.ts'
|
|
|
|
import { Member } from '../../structures/member.ts'
|
|
|
|
import { Role } from '../../structures/role.ts'
|
|
|
|
import { Message } from '../../structures/message.ts'
|
|
|
|
import { Collection } from '../../utils/collection.ts'
|
|
|
|
import { voiceServerUpdate } from './voiceServerUpdate.ts'
|
|
|
|
import { voiceStateUpdate } from './voiceStateUpdate.ts'
|
|
|
|
import { VoiceState } from '../../structures/voiceState.ts'
|
|
|
|
import { messageReactionAdd } from './messageReactionAdd.ts'
|
|
|
|
import { messageReactionRemove } from './messageReactionRemove.ts'
|
|
|
|
import { messageReactionRemoveAll } from './messageReactionRemoveAll.ts'
|
|
|
|
import { messageReactionRemoveEmoji } from './messageReactionRemoveEmoji.ts'
|
|
|
|
import { guildMembersChunk } from './guildMembersChunk.ts'
|
|
|
|
import { presenceUpdate } from './presenceUpdate.ts'
|
|
|
|
import { inviteCreate } from './inviteCreate.ts'
|
|
|
|
import { inviteDelete } from './inviteDelete.ts'
|
|
|
|
import { MessageReaction } from '../../structures/messageReaction.ts'
|
|
|
|
import { Invite } from '../../structures/invite.ts'
|
|
|
|
import { Presence } from '../../structures/presence.ts'
|
|
|
|
import {
|
|
|
|
EveryChannelTypes,
|
|
|
|
EveryTextChannelTypes
|
|
|
|
} from '../../utils/getChannelByType.ts'
|
2020-12-10 04:36:36 +00:00
|
|
|
import { interactionCreate } from './interactionCreate.ts'
|
2020-12-10 06:55:52 +00:00
|
|
|
import { Interaction } from '../../structures/slash.ts'
|
2021-04-04 05:42:15 +00:00
|
|
|
import { CommandContext } from '../../commands/command.ts'
|
|
|
|
import { RequestMethods } from '../../rest/types.ts'
|
2021-01-20 10:05:15 +00:00
|
|
|
import { PartialInvitePayload } from '../../types/invite.ts'
|
2021-01-21 13:20:43 +00:00
|
|
|
import { GuildChannels } from '../../types/guild.ts'
|
2021-01-26 20:15:47 +00:00
|
|
|
import { applicationCommandCreate } from './applicationCommandCreate.ts'
|
|
|
|
import { applicationCommandDelete } from './applicationCommandDelete.ts'
|
|
|
|
import { applicationCommandUpdate } from './applicationCommandUpdate.ts'
|
2021-04-04 05:42:15 +00:00
|
|
|
import { SlashCommand } from '../../interactions/slashCommand.ts'
|
2020-12-02 12:29:52 +00:00
|
|
|
|
|
|
|
export const gatewayHandlers: {
|
|
|
|
[eventCode in GatewayEvents]: GatewayEventHandler | undefined
|
|
|
|
} = {
|
|
|
|
READY: ready,
|
2021-01-26 20:15:47 +00:00
|
|
|
APPLICATION_COMMAND_CREATE: applicationCommandCreate,
|
|
|
|
APPLICATION_COMMAND_DELETE: applicationCommandDelete,
|
|
|
|
APPLICATION_COMMAND_UPDATE: applicationCommandUpdate,
|
2020-12-02 12:29:52 +00:00
|
|
|
RECONNECT: reconnect,
|
|
|
|
RESUMED: resume,
|
|
|
|
CHANNEL_CREATE: channelCreate,
|
|
|
|
CHANNEL_DELETE: channelDelete,
|
|
|
|
CHANNEL_UPDATE: channelUpdate,
|
|
|
|
CHANNEL_PINS_UPDATE: channelPinsUpdate,
|
|
|
|
GUILD_CREATE: guildCreate,
|
|
|
|
GUILD_DELETE: guildDelete,
|
|
|
|
GUILD_UPDATE: guildUpdate,
|
|
|
|
GUILD_BAN_ADD: guildBanAdd,
|
|
|
|
GUILD_BAN_REMOVE: guildBanRemove,
|
|
|
|
GUILD_EMOJIS_UPDATE: guildEmojiUpdate,
|
|
|
|
GUILD_INTEGRATIONS_UPDATE: guildIntegrationsUpdate,
|
|
|
|
GUILD_MEMBER_ADD: guildMemberAdd,
|
|
|
|
GUILD_MEMBER_REMOVE: guildMemberRemove,
|
|
|
|
GUILD_MEMBER_UPDATE: guildMemberUpdate,
|
|
|
|
GUILD_MEMBERS_CHUNK: guildMembersChunk,
|
|
|
|
GUILD_ROLE_CREATE: guildRoleCreate,
|
|
|
|
GUILD_ROLE_UPDATE: guildRoleUpdate,
|
|
|
|
GUILD_ROLE_DELETE: guildRoleDelete,
|
|
|
|
INVITE_CREATE: inviteCreate,
|
|
|
|
INVITE_DELETE: inviteDelete,
|
|
|
|
MESSAGE_CREATE: messageCreate,
|
|
|
|
MESSAGE_UPDATE: messageUpdate,
|
|
|
|
MESSAGE_DELETE: messageDelete,
|
|
|
|
MESSAGE_DELETE_BULK: messageDeleteBulk,
|
|
|
|
MESSAGE_REACTION_ADD: messageReactionAdd,
|
|
|
|
MESSAGE_REACTION_REMOVE: messageReactionRemove,
|
|
|
|
MESSAGE_REACTION_REMOVE_ALL: messageReactionRemoveAll,
|
|
|
|
MESSAGE_REACTION_REMOVE_EMOJI: messageReactionRemoveEmoji,
|
|
|
|
PRESENCE_UPDATE: presenceUpdate,
|
|
|
|
TYPING_START: typingStart,
|
|
|
|
USER_UPDATE: userUpdate,
|
|
|
|
VOICE_STATE_UPDATE: voiceStateUpdate,
|
|
|
|
VOICE_SERVER_UPDATE: voiceServerUpdate,
|
2020-12-10 04:36:36 +00:00
|
|
|
WEBHOOKS_UPDATE: webhooksUpdate,
|
|
|
|
INTERACTION_CREATE: interactionCreate
|
2020-12-02 12:29:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface VoiceServerUpdateData {
|
|
|
|
token: string
|
|
|
|
endpoint: string
|
|
|
|
guild: Guild
|
|
|
|
}
|
|
|
|
|
2021-01-25 11:34:43 +00:00
|
|
|
/** All Client Events */
|
2021-01-20 10:05:15 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
|
|
export type ClientEvents = {
|
2020-12-09 05:18:39 +00:00
|
|
|
/** When Client has successfully connected to Discord */
|
2021-01-24 18:36:19 +00:00
|
|
|
ready: [shard: number]
|
2021-01-25 11:34:43 +00:00
|
|
|
/** When a reconnect was requested by Discord */
|
2021-01-24 18:36:19 +00:00
|
|
|
reconnect: [shard: number]
|
2020-12-09 05:18:39 +00:00
|
|
|
/** When a successful session resume has been done */
|
2021-01-24 18:36:19 +00:00
|
|
|
resumed: [shard: number]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* When a new Channel is created
|
|
|
|
* @param channel New Channel object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
channelCreate: [channel: EveryChannelTypes]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* When a Channel was deleted
|
|
|
|
* @param channel Channel object which was deleted
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
channelDelete: [channel: EveryChannelTypes]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Channel's Pinned Messages were updated
|
|
|
|
* @param before Channel object before update
|
|
|
|
* @param after Channel object after update
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
channelPinsUpdate: [
|
2020-12-02 12:29:52 +00:00
|
|
|
before: EveryTextChannelTypes,
|
|
|
|
after: EveryTextChannelTypes
|
2020-12-29 02:52:30 +00:00
|
|
|
]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Channel was updated
|
|
|
|
* @param before Channel object before update
|
|
|
|
* @param after Channel object after update
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
channelUpdate: [before: EveryChannelTypes, after: EveryChannelTypes]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A User was banned from a Guild
|
|
|
|
* @param guild The Guild from which User was banned
|
|
|
|
* @param user The User who was banned
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildBanAdd: [guild: Guild, user: User]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A ban from a User in Guild was elevated
|
|
|
|
* @param guild Guild from which ban was removed
|
|
|
|
* @param user User of which ban was elevated
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildBanRemove: [guild: Guild, user: User]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Client has joined a new Guild.
|
|
|
|
* @param guild The new Guild object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildCreate: [guild: Guild]
|
2021-01-01 05:00:11 +00:00
|
|
|
/**
|
|
|
|
* A Guild was successfully loaded.
|
|
|
|
* @param guild The Guild object
|
|
|
|
*/
|
|
|
|
guildLoaded: [guild: Guild]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Guild in which Client was either deleted, or bot was kicked
|
|
|
|
* @param guild The Guild object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildDelete: [guild: Guild]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A new Emoji was added to Guild
|
|
|
|
* @param guild Guild in which Emoji was added
|
|
|
|
* @param emoji The Emoji which was added
|
|
|
|
*/
|
2021-01-25 11:34:43 +00:00
|
|
|
guildEmojiAdd: [emoji: Emoji]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* An Emoji was deleted from Guild
|
|
|
|
* @param emoji Emoji which was deleted
|
|
|
|
*/
|
2021-01-25 11:34:43 +00:00
|
|
|
guildEmojiDelete: [emoji: Emoji]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* An Emoji in a Guild was updated
|
|
|
|
* @param before Emoji object before update
|
|
|
|
* @param after Emoji object after update
|
|
|
|
*/
|
2021-01-25 11:34:43 +00:00
|
|
|
guildEmojiUpdate: [before: Emoji, after: Emoji]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Guild's Integrations were updated
|
|
|
|
* @param guild The Guild object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildIntegrationsUpdate: [guild: Guild]
|
2021-01-25 11:34:43 +00:00
|
|
|
/**
|
|
|
|
* Guild's Emojis were updated
|
|
|
|
* @param guild The Guild object
|
|
|
|
*/
|
|
|
|
guildEmojisUpdate: [guild: Guild]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A new Member has joined a Guild
|
|
|
|
* @param member The Member object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildMemberAdd: [member: Member]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Guild Member has either left or was kicked from Guild
|
|
|
|
* @param member The Member object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildMemberRemove: [member: Member]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Guild Member was updated. Nickname changed, role assigned, etc.
|
|
|
|
* @param before Member object before update
|
2020-12-28 22:02:43 +00:00
|
|
|
* @param after Member object after update
|
2020-12-09 05:18:39 +00:00
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildMemberUpdate: [before: Member, after: Member]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A new Role was created in Guild
|
|
|
|
* @param role The new Role object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildRoleCreate: [role: Role]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Role was deleted from the Guild
|
|
|
|
* @param role The Role object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildRoleDelete: [role: Role]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Role was updated in a Guild
|
|
|
|
* @param before Role object before update
|
|
|
|
* @param after Role object after updated
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildRoleUpdate: [before: Role, after: Role]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Guild has been updated. For example name, icon, etc.
|
|
|
|
* @param before Guild object before update
|
|
|
|
* @param after Guild object after update
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
guildUpdate: [before: Guild, after: Guild]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A new Message was created (sent)
|
|
|
|
* @param message The new Message object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageCreate: [message: Message]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Message was deleted.
|
|
|
|
* @param message The Message object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageDelete: [message: Message]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Messages were bulk deleted in a Guild Text Channel
|
|
|
|
* @param channel Channel in which Messages were deleted
|
|
|
|
* @param messages Collection of Messages deleted
|
|
|
|
* @param uncached Set of Messages deleted's IDs which were not cached
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageDeleteBulk: [
|
2021-03-19 15:39:14 +00:00
|
|
|
channel: GuildTextBasedChannel,
|
2020-12-02 12:29:52 +00:00
|
|
|
messages: Collection<string, Message>,
|
|
|
|
uncached: Set<string>
|
2020-12-29 02:52:30 +00:00
|
|
|
]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A Message was updated. For example content, embed, etc.
|
|
|
|
* @param before Message object before update
|
|
|
|
* @param after Message object after update
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageUpdate: [before: Message, after: Message]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Reaction was added to a Message
|
|
|
|
* @param reaction Reaction object
|
|
|
|
* @param user User who added the reaction
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageReactionAdd: [reaction: MessageReaction, user: User]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Reaction was removed fro a Message
|
|
|
|
* @param reaction Reaction object
|
|
|
|
* @param user User to who removed the reaction
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageReactionRemove: [reaction: MessageReaction, user: User]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* All reactions were removed from a Message
|
|
|
|
* @param message Message from which reactions were removed
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageReactionRemoveAll: [message: Message]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* All reactions of a single Emoji were removed
|
|
|
|
* @param message The Message object
|
|
|
|
* @param emoji The Emoji object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
messageReactionRemoveEmoji: [message: Message, emoji: Emoji]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A User has started typing in a Text Channel
|
2020-12-29 02:52:30 +00:00
|
|
|
* @param user User who started typing
|
|
|
|
* @param channel Channel which user started typing in
|
|
|
|
* @param at Date when user started typing
|
|
|
|
* @param guild Guild which user started typing in (can be undefined)
|
2020-12-09 05:18:39 +00:00
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
typingStart: [
|
2020-12-02 12:29:52 +00:00
|
|
|
user: User,
|
2020-12-09 05:18:39 +00:00
|
|
|
channel: TextChannel,
|
2020-12-02 12:29:52 +00:00
|
|
|
at: Date,
|
2020-12-29 02:52:30 +00:00
|
|
|
guild: TypingStartGuildData | undefined
|
|
|
|
]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A new Invite was created
|
|
|
|
* @param invite New Invite object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
inviteCreate: [invite: Invite]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* An Invite was deleted
|
|
|
|
* @param invite Invite object
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
inviteDelete: [invite: Invite]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A User was updated. For example username, avatar, etc.
|
|
|
|
* @param before The User object before update
|
|
|
|
* @param after The User object after update
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
userUpdate: [before: User, after: User]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Client has received credentials for establishing connection to Voice Server
|
2020-12-29 02:52:30 +00:00
|
|
|
* @param data Updated voice server object
|
2020-12-09 05:18:39 +00:00
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
voiceServerUpdate: [data: VoiceServerUpdateData]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A User has joined a Voice Channel
|
2020-12-29 02:52:30 +00:00
|
|
|
* @param state Added voice state object
|
2020-12-09 05:18:39 +00:00
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
voiceStateAdd: [state: VoiceState]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A User has left a Voice Channel
|
2020-12-29 02:52:30 +00:00
|
|
|
* @param state Removed voice state object
|
2020-12-09 05:18:39 +00:00
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
voiceStateRemove: [state: VoiceState]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Voice State of a User has been updated
|
|
|
|
* @param before Voice State object before update
|
|
|
|
* @param after Voice State object after update
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
voiceStateUpdate: [before: VoiceState, after: VoiceState]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* A User's presence has been updated
|
|
|
|
* @param presence New Presence
|
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
presenceUpdate: [presence: Presence]
|
2020-12-09 05:18:39 +00:00
|
|
|
/**
|
|
|
|
* Webhooks of a Channel in a Guild has been updated
|
|
|
|
* @param guild Guild in which Webhooks were updated
|
|
|
|
* @param channel Channel of which Webhooks were updated
|
|
|
|
*/
|
2021-03-19 15:39:14 +00:00
|
|
|
webhooksUpdate: [guild: Guild, channel: GuildTextBasedChannel]
|
2020-12-10 06:55:52 +00:00
|
|
|
/**
|
2020-12-16 13:05:26 +00:00
|
|
|
* An Interaction was created
|
2020-12-29 02:52:30 +00:00
|
|
|
* @param interaction Created interaction object
|
|
|
|
*/
|
|
|
|
interactionCreate: [interaction: Interaction]
|
|
|
|
|
|
|
|
/**
|
|
|
|
* When debug message was made
|
|
|
|
* @param message Debug message
|
2020-12-10 06:55:52 +00:00
|
|
|
*/
|
2020-12-29 02:52:30 +00:00
|
|
|
debug: [message: string]
|
2021-01-07 13:46:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Raw event which gives you access to raw events DISPATCH'd from Gateway
|
|
|
|
* @param evt Event name string
|
|
|
|
* @param payload Payload JSON of the event
|
|
|
|
*/
|
|
|
|
raw: [evt: string, payload: any]
|
2021-01-20 10:05:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* An uncached Message was deleted.
|
|
|
|
* @param payload Message Delete Payload
|
|
|
|
*/
|
|
|
|
messageDeleteUncached: [payload: MessageDeletePayload]
|
|
|
|
|
|
|
|
guildMembersChunk: [
|
|
|
|
guild: Guild,
|
|
|
|
info: {
|
|
|
|
chunkIndex: number
|
|
|
|
chunkCount: number
|
|
|
|
members: string[]
|
|
|
|
presences: string[] | undefined
|
|
|
|
}
|
|
|
|
]
|
|
|
|
guildMembersChunked: [guild: Guild, chunks: number]
|
|
|
|
rateLimit: [data: { method: RequestMethods; url: string; body: any }]
|
|
|
|
inviteDeleteUncached: [invite: PartialInvitePayload]
|
|
|
|
voiceStateRemoveUncached: [data: { guild: Guild; member: Member }]
|
|
|
|
userUpdateUncached: [user: User]
|
|
|
|
webhooksUpdateUncached: [guild: Guild, channelID: string]
|
|
|
|
guildRoleUpdateUncached: [role: Role]
|
|
|
|
guildMemberUpdateUncached: [member: Member]
|
|
|
|
guildMemberRemoveUncached: [member: Member]
|
2021-01-21 13:20:43 +00:00
|
|
|
channelUpdateUncached: [channel: GuildChannels]
|
2021-01-26 20:15:47 +00:00
|
|
|
slashCommandCreate: [cmd: SlashCommand]
|
|
|
|
slashCommandUpdate: [cmd: SlashCommand]
|
|
|
|
slashCommandDelete: [cmd: SlashCommand]
|
2021-01-20 10:05:15 +00:00
|
|
|
commandOwnerOnly: [ctx: CommandContext]
|
|
|
|
commandGuildOnly: [ctx: CommandContext]
|
|
|
|
commandDmOnly: [ctx: CommandContext]
|
|
|
|
commandNSFW: [ctx: CommandContext]
|
|
|
|
commandBotMissingPermissions: [ctx: CommandContext, missing: string[]]
|
|
|
|
commandUserMissingPermissions: [ctx: CommandContext, missing: string[]]
|
|
|
|
commandMissingArgs: [ctx: CommandContext]
|
|
|
|
commandUsed: [ctx: CommandContext]
|
|
|
|
commandError: [ctx: CommandContext, err: Error]
|
2021-03-29 04:09:37 +00:00
|
|
|
gatewayError: [err: ErrorEvent, shards: [number, number]]
|
2020-12-02 12:29:52 +00:00
|
|
|
}
|