Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

The client.

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

allowMention

allowMention: boolean = true

If true, the bot's mention can be used as an additional prefix.

app

app: null | ClientOAuthApplication = null

Information about the bot's OAuth application.

Optional bot

bot: undefined | boolean

caseSensitiveCommands

caseSensitiveCommands: boolean = false

If true, command names are case-sensitive. For example, users may use !ping and !PING interchangeably (assuming ! is a valid prefix). If false, command names in code must be all lowercase.

caseSensitivePrefix

caseSensitivePrefix: boolean = true

If true, prefix matching is case-sensitive.

channelGuildMap

channelGuildMap: {}

Type declaration

  • [s: string]: string

commands

commands: Command[] = ...

A list of all loaded commands.

contextAdditions

contextAdditions: object = ...

An object of stuff to add to the context object for command functions

defaultCommand

defaultCommand: null | Command = null

The default command, executed if allowMention is true and the bot is pinged without a command

disableDefaultMessageListener

disableDefaultMessageListener: boolean = false

If true, the client does not respond to commands by default, and the user must register their own messageCreate listener, which can call processCommand to perform command handling at an arbitrary point during the handler's execution

events

events: EventListener[] = ...

A list of all registered event listeners.

Optional gatewayURL

gatewayURL: undefined | string

globalCommandRequirements

globalCommandRequirements: CommandRequirements = ...

A requirements object that is applied to all commands

groupChannels

groupChannels: Collection<GroupChannel>

guildShardMap

guildShardMap: {}

Type declaration

  • [s: string]: number

guilds

guilds: Collection<Guild>

ignoreBots

ignoreBots: boolean = true

If true, messages from other bot accounts will not trigger commands.

ignoreGlobalRequirements

ignoreGlobalRequirements: boolean = false

If true, requirements set via setGlobalRequirements will be ignored. Used for debugging, probably shouldn't be used in production.

mentionPrefixRegExp

mentionPrefixRegExp: null | RegExp = null

A regular expression which matches mention prefixes. Present after the first 'ready' event is sent.

notes

notes: {}

Type declaration

  • [s: string]: string

on

options

options: ClientOptions

prefix

prefix: string

The prefix used to trigger commands.

Optional prefixFunction

prefixFunction: undefined | PrefixFunction

A custom function that determines the command prefix per message.

privateChannelMap

privateChannelMap: {}

Type declaration

  • [s: string]: string

privateChannels

privateChannels: Collection<PrivateChannel>

relationships

relationships: Collection<Relationship>

shards

shards: ShardManager

startTime

startTime: number

token

token: string

The token of the bot.

unavailableGuilds

unavailableGuilds: Collection<UnavailableGuild>

uptime

uptime: number

user

userGuildSettings

userGuildSettings: {}

Type declaration

userSettings

userSettings: UserSettings

users

voiceConnections

voiceConnections: Collection<VoiceConnection>

Static defaultMaxListeners

defaultMaxListeners: number

Accessors

defaultPrefix

  • get defaultPrefix(): string
  • set defaultPrefix(val: string): void

eventContext

Methods

acceptInvite

  • acceptInvite(inviteID: string): Promise<RESTInvite>

addCommand

addCommandDir

  • addCommandDir(dirname: string): Client

addCommandFile

  • addCommandFile(filename: string): Client

addDir

  • addDir(dirname: string): Client
  • Load the files in a directory and attempt to add a command from each. Searches recursively through directories, but ignores files and nested directories whose names begin with a period.

    Parameters

    • dirname: string

    Returns Client

addEvent

addFile

  • addFile(filename: string): Client
  • Add a command or event exported from a file.

    Parameters

    • filename: string

    Returns Client

addGroupRecipient

  • addGroupRecipient(groupID: string, userID: string): Promise<void>
  • Parameters

    • groupID: string
    • userID: string

    Returns Promise<void>

addGuildMemberRole

  • addGuildMemberRole(guildID: string, memberID: string, roleID: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • memberID: string
    • roleID: string
    • Optional reason: string

    Returns Promise<void>

addListener

  • addListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

addMessageReaction

  • addMessageReaction(channelID: string, messageID: string, reaction: string, userID?: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string
    • reaction: string
    • Optional userID: string

    Returns Promise<void>

addRelationship

  • addRelationship(userID: string, block?: boolean): Promise<void>
  • Parameters

    • userID: string
    • Optional block: boolean

    Returns Promise<void>

addSelfPremiumSubscription

  • addSelfPremiumSubscription(token: string, plan: string): Promise<void>

banGuildMember

  • banGuildMember(guildID: string, userID: string, deleteMessageDays?: number, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • userID: string
    • Optional deleteMessageDays: number
    • Optional reason: string

    Returns Promise<void>

closeVoiceConnection

  • closeVoiceConnection(guildID: string): void

commandForName

  • commandForName(name: string): null | Command
  • Checks the list of registered commands and returns one whch is known by a given name.

    Parameters

    • name: string

    Returns null | Command

connect

  • connect(): Promise<void>
  • Returns Promise<void>

createChannel

createChannelInvite

  • createChannelInvite(channelID: string, options?: { maxAge?: undefined | number; maxUses?: undefined | number; temporary?: undefined | boolean; unique?: undefined | boolean }, reason?: string): Promise<ChannelInvite>
  • Parameters

    • channelID: string
    • Optional options: { maxAge?: undefined | number; maxUses?: undefined | number; temporary?: undefined | boolean; unique?: undefined | boolean }
      • Optional maxAge?: undefined | number
      • Optional maxUses?: undefined | number
      • Optional temporary?: undefined | boolean
      • Optional unique?: undefined | boolean
    • Optional reason: string

    Returns Promise<ChannelInvite>

createChannelWebhook

  • createChannelWebhook(channelID: string, options: { avatar: string; name: string }, reason?: string): Promise<Webhook>
  • Parameters

    • channelID: string
    • options: { avatar: string; name: string }
      • avatar: string
      • name: string
    • Optional reason: string

    Returns Promise<Webhook>

createGroupChannel

  • createGroupChannel(userIDs: string[]): Promise<GroupChannel>

createGuild

createGuildEmoji

  • createGuildEmoji(guildID: string, options: EmojiOptions, reason?: string): Promise<Emoji>

createMessage

createRole

  • Parameters

    • guildID: string
    • Optional options: RoleOptions | Role
    • Optional reason: string

    Returns Promise<Role>

crosspostMessage

deleteChannel

  • deleteChannel(channelID: string, reason?: string): Promise<void>
  • Parameters

    • channelID: string
    • Optional reason: string

    Returns Promise<void>

deleteChannelPermission

  • deleteChannelPermission(channelID: string, overwriteID: string, reason?: string): Promise<void>
  • Parameters

    • channelID: string
    • overwriteID: string
    • Optional reason: string

    Returns Promise<void>

deleteGuild

  • deleteGuild(guildID: string): Promise<void>
  • Parameters

    • guildID: string

    Returns Promise<void>

deleteGuildEmoji

  • deleteGuildEmoji(guildID: string, emojiID: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • emojiID: string
    • Optional reason: string

    Returns Promise<void>

deleteGuildIntegration

  • deleteGuildIntegration(guildID: string, integrationID: string): Promise<void>
  • Parameters

    • guildID: string
    • integrationID: string

    Returns Promise<void>

deleteInvite

  • deleteInvite(inviteID: string, reason?: string): Promise<void>
  • Parameters

    • inviteID: string
    • Optional reason: string

    Returns Promise<void>

deleteMessage

  • deleteMessage(channelID: string, messageID: string, reason?: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string
    • Optional reason: string

    Returns Promise<void>

deleteMessages

  • deleteMessages(channelID: string, messageIDs: string[], reason?: string): Promise<void>
  • Parameters

    • channelID: string
    • messageIDs: string[]
    • Optional reason: string

    Returns Promise<void>

deleteRole

  • deleteRole(guildID: string, roleID: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • roleID: string
    • Optional reason: string

    Returns Promise<void>

deleteSelfConnection

  • deleteSelfConnection(platform: string, id: string): Promise<void>
  • Parameters

    • platform: string
    • id: string

    Returns Promise<void>

deleteSelfPremiumSubscription

  • deleteSelfPremiumSubscription(): Promise<void>

deleteUserNote

  • deleteUserNote(userID: string): Promise<void>
  • Parameters

    • userID: string

    Returns Promise<void>

deleteWebhook

  • deleteWebhook(webhookID: string, token?: string, reason?: string): Promise<void>
  • Parameters

    • webhookID: string
    • Optional token: string
    • Optional reason: string

    Returns Promise<void>

disableSelfMFATOTP

  • disableSelfMFATOTP(code: string): Promise<{ token: string }>
  • Parameters

    • code: string

    Returns Promise<{ token: string }>

disconnect

  • disconnect(options: { reconnect: boolean }): void
  • Parameters

    • options: { reconnect: boolean }
      • reconnect: boolean

    Returns void

editAFK

  • editAFK(afk: boolean): void
  • Parameters

    • afk: boolean

    Returns void

editChannel

  • editChannel(channelID: string, options: { bitrate?: undefined | number; icon?: undefined | string; name?: undefined | string; nsfw?: undefined | boolean; ownerID?: undefined | string; parentID?: undefined | string; rateLimitPerUser?: undefined | number; topic?: undefined | string; userLimit?: undefined | number }, reason?: string): Promise<TextChannel | NewsChannel | VoiceChannel | CategoryChannel | StoreChannel | GroupChannel>
  • Parameters

    • channelID: string
    • options: { bitrate?: undefined | number; icon?: undefined | string; name?: undefined | string; nsfw?: undefined | boolean; ownerID?: undefined | string; parentID?: undefined | string; rateLimitPerUser?: undefined | number; topic?: undefined | string; userLimit?: undefined | number }
      • Optional bitrate?: undefined | number
      • Optional icon?: undefined | string
      • Optional name?: undefined | string
      • Optional nsfw?: undefined | boolean
      • Optional ownerID?: undefined | string
      • Optional parentID?: undefined | string
      • Optional rateLimitPerUser?: undefined | number
      • Optional topic?: undefined | string
      • Optional userLimit?: undefined | number
    • Optional reason: string

    Returns Promise<TextChannel | NewsChannel | VoiceChannel | CategoryChannel | StoreChannel | GroupChannel>

editChannelPermission

  • editChannelPermission(channelID: string, overwriteID: string, allow: number, deny: number, type: string, reason?: string): Promise<void>
  • Parameters

    • channelID: string
    • overwriteID: string
    • allow: number
    • deny: number
    • type: string
    • Optional reason: string

    Returns Promise<void>

editChannelPosition

  • editChannelPosition(channelID: string, position: number): Promise<void>
  • Parameters

    • channelID: string
    • position: number

    Returns Promise<void>

editGuild

  • Parameters

    • guildID: string
    • options: GuildOptions
    • Optional reason: string

    Returns Promise<Guild>

editGuildEmoji

  • editGuildEmoji(guildID: string, emojiID: string, options: { name?: undefined | string; roles?: undefined | string[] }, reason?: string): Promise<Emoji>
  • Parameters

    • guildID: string
    • emojiID: string
    • options: { name?: undefined | string; roles?: undefined | string[] }
      • Optional name?: undefined | string
      • Optional roles?: undefined | string[]
    • Optional reason: string

    Returns Promise<Emoji>

editGuildIntegration

  • editGuildIntegration(guildID: string, integrationID: string, options: IntegrationOptions): Promise<void>

editGuildMember

  • editGuildMember(guildID: string, memberID: string, options: MemberOptions, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • memberID: string
    • options: MemberOptions
    • Optional reason: string

    Returns Promise<void>

editMessage

editNickname

  • editNickname(guildID: string, nick: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • nick: string
    • Optional reason: string

    Returns Promise<void>

editRole

  • editRole(guildID: string, roleID: string, options: RoleOptions, reason?: string): Promise<Role>
  • Parameters

    • guildID: string
    • roleID: string
    • options: RoleOptions
    • Optional reason: string

    Returns Promise<Role>

editRolePosition

  • editRolePosition(guildID: string, roleID: string, position: number): Promise<void>
  • Parameters

    • guildID: string
    • roleID: string
    • position: number

    Returns Promise<void>

editSelf

  • editSelf(options: { avatar?: undefined | string; username?: undefined | string }): Promise<ExtendedUser>
  • Parameters

    • options: { avatar?: undefined | string; username?: undefined | string }
      • Optional avatar?: undefined | string
      • Optional username?: undefined | string

    Returns Promise<ExtendedUser>

editSelfConnection

  • editSelfConnection(platform: string, id: string, data: { friendSync: boolean; visibility: number }): Promise<Connection>
  • Parameters

    • platform: string
    • id: string
    • data: { friendSync: boolean; visibility: number }
      • friendSync: boolean
      • visibility: number

    Returns Promise<Connection>

editSelfSettings

editStatus

editUserNote

  • editUserNote(userID: string, note: string): Promise<void>
  • Parameters

    • userID: string
    • note: string

    Returns Promise<void>

editWebhook

  • editWebhook(webhookID: string, options: { avatar?: undefined | string; name?: undefined | string }, token?: string, reason?: string): Promise<Webhook>
  • Parameters

    • webhookID: string
    • options: { avatar?: undefined | string; name?: undefined | string }
      • Optional avatar?: undefined | string
      • Optional name?: undefined | string
    • Optional token: string
    • Optional reason: string

    Returns Promise<Webhook>

enableSelfMFATOTP

  • enableSelfMFATOTP(secret: string, code: string): Promise<{ backup_codes: { code: string; consumed: boolean }[]; token: string }>
  • Parameters

    • secret: string
    • code: string

    Returns Promise<{ backup_codes: { code: string; consumed: boolean }[]; token: string }>

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

executeSlackWebhook

  • executeSlackWebhook(webhookID: string, token: string, options?: { auth?: undefined | boolean; wait?: undefined | boolean }): Promise<void>
  • Parameters

    • webhookID: string
    • token: string
    • Optional options: { auth?: undefined | boolean; wait?: undefined | boolean }
      • Optional auth?: undefined | boolean
      • Optional wait?: undefined | boolean

    Returns Promise<void>

executeWebhook

extendContext

  • extendContext(options: object): Client
  • Adds things to the context objects the client sends.

    Parameters

    • options: object

    Returns Client

followChannel

  • followChannel(channelID: string, webhookChannelID: string): Promise<ChannelFollow>
  • Parameters

    • channelID: string
    • webhookChannelID: string

    Returns Promise<ChannelFollow>

getBotGateway

  • getBotGateway(): Promise<{ session_start_limit: { remaining: number; reset_after: number; total: number }; shards: number; url: string }>
  • Returns Promise<{ session_start_limit: { remaining: number; reset_after: number; total: number }; shards: number; url: string }>

getChannel

getChannelInvites

getChannelWebhooks

  • getChannelWebhooks(channelID: string): Promise<Webhook[]>

getDMChannel

getGateway

  • getGateway(): Promise<{ url: string }>
  • Returns Promise<{ url: string }>

getGuildAuditLogs

  • getGuildAuditLogs(guildID: string, limit?: number, before?: string, actionType?: number): Promise<GuildAuditLog>
  • Parameters

    • guildID: string
    • Optional limit: number
    • Optional before: string
    • Optional actionType: number

    Returns Promise<GuildAuditLog>

getGuildBan

  • getGuildBan(guildID: string, userID: string): Promise<{ reason?: undefined | string; user: User }>
  • Parameters

    • guildID: string
    • userID: string

    Returns Promise<{ reason?: undefined | string; user: User }>

getGuildBans

  • getGuildBans(guildID: string): Promise<{ reason?: undefined | string; user: User }[]>
  • Parameters

    • guildID: string

    Returns Promise<{ reason?: undefined | string; user: User }[]>

getGuildEmbed

  • getGuildEmbed(guildID: string): Promise<GuildEmbed>

getGuildIntegrations

getGuildInvites

getGuildPreview

getGuildVanity

  • getGuildVanity(guildID: string): Promise<{ code?: undefined | string; uses?: undefined | number }>
  • Parameters

    • guildID: string

    Returns Promise<{ code?: undefined | string; uses?: undefined | number }>

getGuildWebhooks

  • getGuildWebhooks(guildID: string): Promise<Webhook[]>

getInvite

  • getInvite(inviteID: string, withCounts?: boolean): Promise<RESTInvite>
  • Parameters

    • inviteID: string
    • Optional withCounts: boolean

    Returns Promise<RESTInvite>

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getMessage

getMessageReaction

  • getMessageReaction(channelID: string, messageID: string, reaction: string, limit?: number, before?: string, after?: string): Promise<User[]>
  • Parameters

    • channelID: string
    • messageID: string
    • reaction: string
    • Optional limit: number
    • Optional before: string
    • Optional after: string

    Returns Promise<User[]>

getMessages

  • getMessages(channelID: string, limit?: number, before?: string, after?: string, around?: string): Promise<Message<TextableChannel>[]>
  • Parameters

    • channelID: string
    • Optional limit: number
    • Optional before: string
    • Optional after: string
    • Optional around: string

    Returns Promise<Message<TextableChannel>[]>

getOAuthApplication

getPins

getPrefixesForMessage

  • getPrefixesForMessage(msg: any): Promise<string[]>

getPruneCount

  • getPruneCount(guildID: string, options?: GetPruneOptions): Promise<number>

getRESTChannel

  • getRESTChannel(channelID: string): Promise<AnyChannel>

getRESTGuild

  • getRESTGuild(guildID: string, withCounts?: boolean): Promise<Guild>
  • Parameters

    • guildID: string
    • Optional withCounts: boolean

    Returns Promise<Guild>

getRESTGuildChannels

getRESTGuildEmoji

  • getRESTGuildEmoji(guildID: string, emojiID: string): Promise<Emoji>
  • Parameters

    • guildID: string
    • emojiID: string

    Returns Promise<Emoji>

getRESTGuildEmojis

  • getRESTGuildEmojis(guildID: string): Promise<Emoji[]>

getRESTGuildMember

  • getRESTGuildMember(guildID: string, memberID: string): Promise<Member>
  • Parameters

    • guildID: string
    • memberID: string

    Returns Promise<Member>

getRESTGuildMembers

  • getRESTGuildMembers(guildID: string, limit?: number, after?: string): Promise<Member[]>
  • Parameters

    • guildID: string
    • Optional limit: number
    • Optional after: string

    Returns Promise<Member[]>

getRESTGuildRoles

  • getRESTGuildRoles(guildID: string): Promise<Role[]>
  • Parameters

    • guildID: string

    Returns Promise<Role[]>

getRESTGuilds

  • getRESTGuilds(limit?: number, before?: string, after?: string): Promise<Guild[]>
  • Parameters

    • Optional limit: number
    • Optional before: string
    • Optional after: string

    Returns Promise<Guild[]>

getRESTUser

  • getRESTUser(userID: string): Promise<User>
  • Parameters

    • userID: string

    Returns Promise<User>

getSelf

getSelfBilling

  • getSelfBilling(): Promise<{ payment_gateway?: undefined | string; payment_source?: undefined | { brand: string; expires_month: number; expires_year: number; invalid: boolean; last_4: number; type: string }; premium_subscription?: undefined | { canceled_at?: undefined | string; created_at: string; current_period_end?: undefined | string; current_period_start?: undefined | string; ended_at?: undefined | string; plan: string; status: number } }>
  • Returns Promise<{ payment_gateway?: undefined | string; payment_source?: undefined | { brand: string; expires_month: number; expires_year: number; invalid: boolean; last_4: number; type: string }; premium_subscription?: undefined | { canceled_at?: undefined | string; created_at: string; current_period_end?: undefined | string; current_period_start?: undefined | string; ended_at?: undefined | string; plan: string; status: number } }>

getSelfConnections

getSelfMFACodes

  • getSelfMFACodes(password: string, regenerate?: boolean): Promise<{ backup_codes: { code: string; consumed: boolean }[] }>
  • Parameters

    • password: string
    • Optional regenerate: boolean

    Returns Promise<{ backup_codes: { code: string; consumed: boolean }[] }>

getSelfPayments

  • getSelfPayments(): Promise<{ amount: number; amount_refunded: number; created_at: string; currency: string; description: string; status: number }[]>
  • Returns Promise<{ amount: number; amount_refunded: number; created_at: string; currency: string; description: string; status: number }[]>

getSelfSettings

getUserProfile

getVoiceRegions

  • getVoiceRegions(guildID: string): Promise<VoiceRegion[]>

getWebhook

  • getWebhook(webhookID: string, token?: string): Promise<Webhook>
  • Parameters

    • webhookID: string
    • Optional token: string

    Returns Promise<Webhook>

hasCommand

  • Returns the command as a list of parsed strings, or null if it's not a valid command

    Parameters

    Returns Promise<null | [string, string, ...string[]]>

joinVoiceChannel

  • joinVoiceChannel(channelID: string, options?: { opusOnly?: undefined | boolean; shared?: undefined | boolean }): Promise<VoiceConnection>
  • Parameters

    • channelID: string
    • Optional options: { opusOnly?: undefined | boolean; shared?: undefined | boolean }
      • Optional opusOnly?: undefined | boolean
      • Optional shared?: undefined | boolean

    Returns Promise<VoiceConnection>

kickGuildMember

  • kickGuildMember(guildID: string, userID: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • userID: string
    • Optional reason: string

    Returns Promise<void>

leaveGuild

  • leaveGuild(guildID: string): Promise<void>
  • Parameters

    • guildID: string

    Returns Promise<void>

leaveVoiceChannel

  • leaveVoiceChannel(channelID: string): void
  • Parameters

    • channelID: string

    Returns void

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

off

  • off(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

once

  • once(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

pinMessage

  • pinMessage(channelID: string, messageID: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string

    Returns Promise<void>

prefixes

  • Registers a function used to determine what prefixes to use on a per-message basis. Returns a string or an array of strings that should be recognized as prefixes for the message, or undefined to specify that the default prefix should be used. If the allowMention client option is set, mentions will work regardless of the return value of your custom function. The empty prefix also always works in private channels.

    Parameters

    Returns Client

prependListener

  • prependListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

processCommand

  • processCommand(msg: any): Promise<boolean>
  • Given a message, tries to parse a command from it. If it is a command, executes it and returns true; otherwise, returns false.

    Parameters

    • msg: any

    Returns Promise<boolean>

pruneMembers

purgeChannel

  • purgeChannel(channelID: string, limit?: number, filter?: (m: Message<TextableChannel>) => boolean, before?: string, after?: string, reason?: string): Promise<number>

rawListeners

  • rawListeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

reloadCommands

reloadFiles

  • Reloads all commands and events that were loaded via from files. Useful for development to hot-reload components as you work on them.

    Returns Client

removeAllListeners

  • removeAllListeners(event?: string | symbol): Client
  • Parameters

    • Optional event: string | symbol

    Returns Client

removeGroupRecipient

  • removeGroupRecipient(groupID: string, userID: string): Promise<void>
  • Parameters

    • groupID: string
    • userID: string

    Returns Promise<void>

removeGuildMemberRole

  • removeGuildMemberRole(guildID: string, memberID: string, roleID: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • memberID: string
    • roleID: string
    • Optional reason: string

    Returns Promise<void>

removeListener

  • removeListener(event: string | symbol, listener: (...args: any[]) => void): Client
  • Parameters

    • event: string | symbol
    • listener: (...args: any[]) => void
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Client

removeMessageReaction

  • removeMessageReaction(channelID: string, messageID: string, reaction: string, userID?: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string
    • reaction: string
    • Optional userID: string

    Returns Promise<void>

removeMessageReactionEmoji

  • removeMessageReactionEmoji(channelID: string, messageID: string, reaction: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string
    • reaction: string

    Returns Promise<void>

removeMessageReactions

  • removeMessageReactions(channelID: string, messageID: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string

    Returns Promise<void>

removeRelationship

  • removeRelationship(userID: string): Promise<void>
  • Parameters

    • userID: string

    Returns Promise<void>

searchChannelMessages

searchGuildMembers

  • searchGuildMembers(guildID: string, query: string, limit?: number): Promise<Member[]>
  • Parameters

    • guildID: string
    • query: string
    • Optional limit: number

    Returns Promise<Member[]>

searchGuildMessages

sendChannelTyping

  • sendChannelTyping(channelID: string): Promise<void>
  • Parameters

    • channelID: string

    Returns Promise<void>

setDefaultCommand

  • setDefaultCommand(commandName: string): Client
  • Set the default command. This command is executed when allowMention is true and the bot is pinged with no command.

    Parameters

    • commandName: string

    Returns Client

setGlobalRequirements

setMaxListeners

  • setMaxListeners(n: number): Client

splitPrefixFromContent

syncGuildIntegration

  • syncGuildIntegration(guildID: string, integrationID: string): Promise<void>
  • Parameters

    • guildID: string
    • integrationID: string

    Returns Promise<void>

toJSON

  • Parameters

    • Optional props: string[]

    Returns JSONCache

toString

  • toString(): string
  • Returns string

unbanGuildMember

  • unbanGuildMember(guildID: string, userID: string, reason?: string): Promise<void>
  • Parameters

    • guildID: string
    • userID: string
    • Optional reason: string

    Returns Promise<void>

unpinMessage

  • unpinMessage(channelID: string, messageID: string): Promise<void>
  • Parameters

    • channelID: string
    • messageID: string

    Returns Promise<void>

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • deprecated

    since v4.0.0

    Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc