Members
(constant) Discord
Send a user a link to their avatar
- Source:
(constant) Discord
A bot that welcomes new guild members when they join
- Source:
(constant) Discord
A ping pong bot, whenever you send "ping", it replies "pong".
- Source:
(constant) Discord
Send a message using a webhook
- Source:
(nullable) lastMessageID :Snowflake
The ID of the last message in the channel, if one was sent
Type:
(nullable) lastPinTimestamp :number
The timestamp when the last pinned message was pinned, if there was one
Type:
- number
messages :MessageManager
A manager of the messages sent to this channel
Type:
Methods
makeDiscordjsError(Base) → {DiscordjsError}
Extend an error of some sort into a DiscordjsError.
Parameters:
Name | Type | Description |
---|---|---|
Base |
Error | Base error to extend |
- Source:
Returns:
- Type
- DiscordjsError
message(key, args) → {string}
Format the message for an error.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | Error key |
args |
Array.<*> | Arguments to pass for util format or as function args |
- Source:
Returns:
Formatted string
- Type
- string
register(sym, val)
Register an error code and message.
Parameters:
Name | Type | Description |
---|---|---|
sym |
string | Unique name for the error |
val |
* | Value of the error |
- Source:
Type Definitions
ActivityOptions
Options for setting an activity
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
url |
string |
<optional> |
Twitch stream URL |
type |
ActivityType | number |
<optional> |
Type of the activity |
shardID |
number | Array.<number> |
<optional> |
Shard Id(s) to have the activity set on |
- Source:
ActivityType
Type:
- string
- Source:
APIError
An error encountered while performing an API request. Here are the potential errors:
* UNKNOWN_ACCOUNT
* UNKNOWN_APPLICATION
* UNKNOWN_CHANNEL
* UNKNOWN_GUILD
* UNKNOWN_INTEGRATION
* UNKNOWN_INVITE
* UNKNOWN_MEMBER
* UNKNOWN_MESSAGE
* UNKNOWN_OVERWRITE
* UNKNOWN_PROVIDER
* UNKNOWN_ROLE
* UNKNOWN_TOKEN
* UNKNOWN_USER
* UNKNOWN_EMOJI
* UNKNOWN_WEBHOOK
* BOT_PROHIBITED_ENDPOINT
* BOT_ONLY_ENDPOINT
* MAXIMUM_GUILDS
* MAXIMUM_FRIENDS
* MAXIMUM_PINS
* MAXIMUM_ROLES
* MAXIMUM_REACTIONS
* MAXIMUM_CHANNELS
* MAXIMUM_INVITES
* UNAUTHORIZED
* USER_BANNED
* MISSING_ACCESS
* INVALID_ACCOUNT_TYPE
* CANNOT_EXECUTE_ON_DM
* EMBED_DISABLED
* CANNOT_EDIT_MESSAGE_BY_OTHER
* CANNOT_SEND_EMPTY_MESSAGE
* CANNOT_MESSAGE_USER
* CANNOT_SEND_MESSAGES_IN_VOICE_CHANNEL
* CHANNEL_VERIFICATION_LEVEL_TOO_HIGH
* OAUTH2_APPLICATION_BOT_ABSENT
* MAXIMUM_OAUTH2_APPLICATIONS
* INVALID_OAUTH_STATE
* MISSING_PERMISSIONS
* INVALID_AUTHENTICATION_TOKEN
* NOTE_TOO_LONG
* INVALID_BULK_DELETE_QUANTITY
* CANNOT_PIN_MESSAGE_IN_OTHER_CHANNEL
* INVALID_OR_TAKEN_INVITE_CODE
* CANNOT_EXECUTE_ON_SYSTEM_MESSAGE
* INVALID_OAUTH_TOKEN
* BULK_DELETE_MESSAGE_TOO_OLD
* INVALID_FORM_BODY
* INVITE_ACCEPTED_TO_GUILD_NOT_CONTAINING_BOT
* INVALID_API_VERSION
* REACTION_BLOCKED
* RESOURCE_OVERLOADED
Type:
- string
- Source:
ApplicationAsset
Asset data.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
Snowflake | The asset ID |
name |
string | The asset name |
type |
string | The asset type |
AuditLogAction
The action of an entry. Here are the available actions:
* ALL: null
* GUILD_UPDATE: 1
* CHANNEL_CREATE: 10
* CHANNEL_UPDATE: 11
* CHANNEL_DELETE: 12
* CHANNEL_OVERWRITE_CREATE: 13
* CHANNEL_OVERWRITE_UPDATE: 14
* CHANNEL_OVERWRITE_DELETE: 15
* MEMBER_KICK: 20
* MEMBER_PRUNE: 21
* MEMBER_BAN_ADD: 22
* MEMBER_BAN_REMOVE: 23
* MEMBER_UPDATE: 24
* MEMBER_ROLE_UPDATE: 25
* MEMBER_MOVE: 26
* MEMBER_DISCONNECT: 27
* BOT_ADD: 28,
* ROLE_CREATE: 30
* ROLE_UPDATE: 31
* ROLE_DELETE: 32
* INVITE_CREATE: 40
* INVITE_UPDATE: 41
* INVITE_DELETE: 42
* WEBHOOK_CREATE: 50
* WEBHOOK_UPDATE: 51
* WEBHOOK_DELETE: 52
* EMOJI_CREATE: 60
* EMOJI_UPDATE: 61
* EMOJI_DELETE: 62
* MESSAGE_DELETE: 72
* MESSAGE_BULK_DELETE: 73
* MESSAGE_PIN: 74
* MESSAGE_UNPIN: 75
* INTEGRATION_CREATE: 80
* INTEGRATION_UPDATE: 81
* INTEGRATION_DELETE: 82
Type:
- number | string
- Source:
AuditLogActionType
The action type of an entry, e.g. `CREATE`. Here are the available types:
* CREATE
* DELETE
* UPDATE
* ALL
Type:
- string
- Source:
AuditLogChange
An entry in the audit log representing a specific change.
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
key |
string | The property that was changed, e.g. `nick` for nickname changes | |
old |
* |
<optional> |
The old value of the change, e.g. for nicknames, the old nickname |
new |
* |
<optional> |
The new value of the change, e.g. for nicknames, the new nickname |
- Source:
AuditLogEntryTarget
The target of an entry. It can be one of:
* A guild
* A user
* A role
* An emoji
* An invite
* A webhook
* An integration
* An object with an id key if target was deleted
* An object where the keys represent either the new value or the old value
Type:
- Object | Guild | User | Role | GuildEmoji | Invite | Webhook | Integration
- Source:
AuditLogTargetType
The target type of an entry, e.g. `GUILD`. Here are the available types:
* GUILD
* CHANNEL
* USER
* ROLE
* INVITE
* WEBHOOK
* EMOJI
* MESSAGE
* INTEGRATION
Type:
- string
- Source:
AwaitMessagesOptions
An object containing the same properties as CollectorOptions, but a few more:
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
errors |
Array.<string> |
<optional> |
Stop/end reasons that cause the promise to reject |
AwaitReactionsOptions
An object containing the same properties as CollectorOptions, but a few more:
Type:
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
errors |
Array.<string> |
<optional> |
Stop/end reasons that cause the promise to reject |
- Source:
BanInfo
An object containing information about a guild member's ban.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
user |
User | User that was banned | |
reason |
string |
<nullable> |
Reason the user was banned |
- Source:
Base64Resolvable
Data that resolves to give a Base64 string, typically for image uploading. This can be:
* A Buffer
* A base64 string
Type:
- Buffer | string
- Source:
BitFieldResolvable
Data that can be resolved to give a bitfield. This can be:
* A string (see BitField.FLAGS)
* A bit number
* An instance of BitField
* An Array of BitFieldResolvable
Type:
- string | number | BitField | Array.<BitFieldResolvable>
- Source:
BufferResolvable
Data that can be resolved to give a Buffer. This can be:
* A Buffer
* The path to a local file
* A URL
Type:
- string | Buffer
- Source:
ChannelData
The data for a guild channel.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
The name of the channel |
position |
number |
<optional> |
The position of the channel |
topic |
string |
<optional> |
The topic of the text channel |
nsfw |
boolean |
<optional> |
Whether the channel is NSFW |
bitrate |
number |
<optional> |
The bitrate of the voice channel |
userLimit |
number |
<optional> |
The user limit of the voice channel |
parentID |
Snowflake |
<optional> |
The parent ID of the channel |
lockPermissions |
boolean |
<optional> |
Lock the permissions of the channel to what the parent's permissions are |
permissionOverwrites |
Array.<OverwriteResolvable> | Collection.<Snowflake, OverwriteResolvable> |
<optional> |
Permission overwrites for the channel |
rateLimitPerUser |
number |
<optional> |
The ratelimit per user for the channel in seconds |
- Source:
ChannelLogsQueryOptions
The parameters to pass in when requesting previous messages from a channel. `around`, `before` and
`after` are mutually exclusive. All the parameters are optional.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
limit |
number |
<optional> |
50 | Number of messages to acquire |
before |
Snowflake |
<optional> |
ID of a message to get the messages that were posted before it | |
after |
Snowflake |
<optional> |
ID of a message to get the messages that were posted after it | |
around |
Snowflake |
<optional> |
ID of a message to get the messages that were posted around it |
- Source:
ChannelPosition
The data needed for updating a channel's position.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
channel |
ChannelResolvable | Channel to update |
position |
number | New position for the channel |
- Source:
ChannelResolvable
Data that can be resolved to give a Channel object. This can be:
* A Channel object
* A Snowflake
Type:
- Source:
ClientOptions
Options for a client.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
shards |
number | Array.<number> | string |
<optional> |
ID of the shard to run, or an array of shard IDs. If not specified, the client will spawn ClientOptions#shardCount shards. If set to `auto`, it will fetch the recommended amount of shards from Discord and spawn that amount | |
shardCount |
number |
<optional> |
1 | The total amount of shards used by all processes of this bot (e.g. recommended shard count, shard count of the ShardingManager) |
messageCacheMaxSize |
number |
<optional> |
200 | Maximum number of messages to cache per channel (-1 or Infinity for unlimited - don't do this without message sweeping, otherwise memory usage will climb indefinitely) |
messageCacheLifetime |
number |
<optional> |
0 | How long a message should stay in the cache until it is considered sweepable (in seconds, 0 for forever) |
messageSweepInterval |
number |
<optional> |
0 | How frequently to remove messages from the cache that are older than the message cache lifetime (in seconds, 0 for never) |
fetchAllMembers |
boolean |
<optional> |
false | Whether to cache all guild members and users upon startup, as well as upon joining a guild (should be avoided whenever possible) |
disableMentions |
DisableMentionType |
<optional> |
'none' | Default value for MessageOptions#disableMentions |
allowedMentions |
MessageMentionOptions |
<optional> |
Default value for MessageOptions#allowedMentions | |
partials |
Array.<PartialType> |
<optional> |
Structures allowed to be partial. This means events can be emitted even when they're missing all the data for a particular structure. See the "Partials" topic listed in the sidebar for some important usage information, as partials require you to put checks in place when handling data. | |
restWsBridgeTimeout |
number |
<optional> |
5000 | Maximum time permitted between REST responses and their corresponding websocket events |
restTimeOffset |
number |
<optional> |
500 | Extra time in milliseconds to wait before continuing to make REST requests (higher values will reduce rate-limiting errors on bad connections) |
restRequestTimeout |
number |
<optional> |
15000 | Time to wait before cancelling a REST request, in milliseconds |
restSweepInterval |
number |
<optional> |
60 | How frequently to delete inactive request buckets, in seconds (or 0 for never) |
retryLimit |
number |
<optional> |
1 | How many times to retry on 5XX errors (Infinity for indefinite amount of retries) |
presence |
PresenceData |
<optional> |
Presence data to use upon login | |
ws |
WebsocketOptions |
<optional> |
Options for the WebSocket | |
http |
HTTPOptions |
<optional> |
HTTP options |
- Source:
ClientPresenceStatus
The status of this presence:
* **`online`** - user is online
* **`idle`** - user is AFK
* **`dnd`** - user is in Do Not Disturb
Type:
- string
- Source:
CollectorFilter(…args, collection) → {boolean|Promise.<boolean>}
Filter to be applied to the collector.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
* |
<repeatable> |
Any arguments received by the listener |
collection |
Collection | The items collected by this collector |
Returns:
- Type
- boolean | Promise.<boolean>
CollectorOptions
Options to be applied to the collector.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
time |
number |
<optional> |
How long to run the collector for in milliseconds | |
idle |
number |
<optional> |
How long to stop the collector after inactivity in milliseconds | |
dispose |
boolean |
<optional> |
false | Whether to dispose data when it's deleted |
ColorResolvable
Can be a number, hex string, an RGB array like:
```js
[255, 0, 255] // purple
```
or one of the following strings:
- `DEFAULT`
- `WHITE`
- `AQUA`
- `GREEN`
- `BLUE`
- `YELLOW`
- `PURPLE`
- `LUMINOUS_VIVID_PINK`
- `GOLD`
- `ORANGE`
- `RED`
- `GREY`
- `DARKER_GREY`
- `NAVY`
- `DARK_AQUA`
- `DARK_GREEN`
- `DARK_BLUE`
- `DARK_PURPLE`
- `DARK_VIVID_PINK`
- `DARK_GOLD`
- `DARK_ORANGE`
- `DARK_RED`
- `DARK_GREY`
- `LIGHT_GREY`
- `DARK_NAVY`
- `BLURPLE`
- `GREYPLE`
- `DARK_BUT_NOT_BLACK`
- `NOT_QUITE_BLACK`
- `RANDOM`
Type:
- string | number | Array.<number>
- Source:
CrosspostedChannel
Crossposted channel data.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
channelID |
string | ID of the mentioned channel |
guildID |
string | ID of the guild that has the channel |
type |
string | Type of the channel |
name |
string | The name of the channel |
- Source:
DeconstructedSnowflake
A deconstructed snowflake.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
timestamp |
number | Timestamp the snowflake was created |
date |
Date | Date the snowflake was created |
workerID |
number | Worker ID in the snowflake |
processID |
number | Process ID in the snowflake |
increment |
number | Increment in the snowflake |
binary |
string | Binary representation of the snowflake |
- Source:
DefaultMessageNotifications
The value set for a guild's default message notifications, e.g. `ALL`. Here are the available types:
* ALL
* MENTIONS
Type:
- string
- Source:
DisableMentionType
The type of mentions to disable.
- `none`
- `all`
- `everyone`
Type:
- string
EmbedField
Represents a field of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
name |
string | The name of this field |
value |
string | The value of this field |
inline |
boolean | If this field will be displayed inline |
- Source:
EmbedFieldData
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
StringResolvable | The name of this field | |
value |
StringResolvable | The value of this field | |
inline |
boolean |
<optional> |
If this field will be displayed inline |
- Source:
EmojiIdentifierResolvable
Data that can be resolved to give an emoji identifier. This can be:
* The unicode representation of an emoji
* An EmojiResolvable
Type:
- string | EmojiResolvable
EmojiResolvable
Data that can be resolved into an GuildEmoji object. This can be:
* A custom emoji ID
* A GuildEmoji object
* A ReactionEmoji object
Type:
- Source:
ExplicitContentFilterLevel
The value set for the explicit content filter levels for a guild:
* DISABLED
* MEMBERS_WITHOUT_ROLES
* ALL_MEMBERS
Type:
- string
- Source:
ExtendableStructure
An extendable structure:
* **`GuildEmoji`**
* **`DMChannel`**
* **`TextChannel`**
* **`VoiceChannel`**
* **`CategoryChannel`**
* **`NewsChannel`**
* **`StoreChannel`**
* **`GuildMember`**
* **`Guild`**
* **`Message`**
* **`MessageReaction`**
* **`Presence`**
* **`ClientPresence`**
* **`VoiceState`**
* **`Role`**
* **`User`**
Type:
- string
- Source:
Features
An array of enabled guild features, here are the possible values:
* ANIMATED_ICON
* BANNER
* COMMERCE
* COMMUNITY
* DISCOVERABLE
* FEATURABLE
* INVITE_SPLASH
* NEWS
* PARTNERED
* VANITY_URL
* VERIFIED
* VIP_REGIONS
* WELCOME_SCREEN_ENABLED
Type:
- string
- Source:
FetchMemberOptions
Options used to fetch a single member from a guild.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
user |
UserResolvable | The user to fetch | ||
cache |
boolean |
<optional> |
true | Whether or not to cache the fetched member |
force |
boolean |
<optional> |
false | Whether to skip the cache check and request the API |
FetchMembersOptions
Options used to fetch multiple members from a guild.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
user |
UserResolvable | Array.<UserResolvable> | The user(s) to fetch | ||
query |
string |
<nullable> |
Limit fetch to members with similar usernames | |
limit |
number |
<optional> |
0 | Maximum number of members to request |
withPresences |
boolean |
<optional> |
false | Whether or not to include the presences |
time |
number |
<optional> |
120e3 | Timeout for receipt of members |
nonce |
string |
<nullable> |
Nonce for this request (32 characters max - default to base 16 now timestamp) | |
force |
boolean |
<optional> |
false | Whether to skip the cache check and request the API |
FileOptions
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
attachment |
BufferResolvable | File to attach | ||
name |
string |
<optional> |
'file.jpg' | Filename of the attachment |
GuildChannelResolvable
Data that can be resolved to give a Guild Channel object. This can be:
* A GuildChannel object
* A Snowflake
Type:
GuildEditData
The data for editing a guild.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
The name of the guild |
region |
string |
<optional> |
The region of the guild |
verificationLevel |
VerificationLevel | number |
<optional> |
The verification level of the guild |
explicitContentFilter |
ExplicitContentFilterLevel | number |
<optional> |
The level of the explicit content filter |
afkChannel |
ChannelResolvable |
<optional> |
The AFK channel of the guild |
systemChannel |
ChannelResolvable |
<optional> |
The system channel of the guild |
afkTimeout |
number |
<optional> |
The AFK timeout of the guild |
icon |
Base64Resolvable |
<optional> |
The icon of the guild |
owner |
GuildMemberResolvable |
<optional> |
The owner of the guild |
splash |
Base64Resolvable |
<optional> |
The invite splash image of the guild |
discoverySplash |
Base64Resolvable |
<optional> |
The discovery splash image of the guild |
banner |
Base64Resolvable |
<optional> |
The banner of the guild |
defaultMessageNotifications |
DefaultMessageNotifications | number |
<optional> |
The default message notifications |
systemChannelFlags |
SystemChannelFlagsResolvable |
<optional> |
The system channel flags of the guild |
rulesChannel |
ChannelResolvable |
<optional> |
The rules channel of the guild |
publicUpdatesChannel |
ChannelResolvable |
<optional> |
The community updates channel of the guild |
preferredLocale |
string |
<optional> |
The preferred locale of the guild |
- Source:
GuildEmojiEditData
Data for editing an emoji.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
The name of the emoji |
roles |
Collection.<Snowflake, Role> | Array.<RoleResolvable> |
<optional> |
Roles to restrict emoji to |
- Source:
GuildMemberEditData
The data for editing a guild member.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
nick |
string |
<optional> |
The nickname to set for the member |
roles |
Collection.<Snowflake, Role> | Array.<RoleResolvable> |
<optional> |
The roles or role IDs to apply |
mute |
boolean |
<optional> |
Whether or not the member should be muted |
deaf |
boolean |
<optional> |
Whether or not the member should be deafened |
channel |
ChannelResolvable | null |
<optional> |
Channel to move member to (if they are connected to voice), or `null` if you want to kick them from voice |
- Source:
GuildMemberResolvable
Data that resolves to give a GuildMember object. This can be:
* A GuildMember object
* A User resolvable
Type:
GuildResolvable
Data that resolves to give a Guild object. This can be:
* A Guild object
* A GuildChannel object
* A GuildEmoji object
* A Role object
* A Snowflake
* An Invite object
Type:
- Guild | GuildChannel | GuildMember | GuildEmoji | Role | Snowflake | Invite
- Source:
GuildRolePosition
The data needed for updating a guild role's position
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
role |
RoleResolveable | The ID of the role |
position |
number | The position to update |
- Source:
GuildWidget
Data for the Guild Widget object
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
enabled |
boolean | Whether the widget is enabled | |
channel |
GuildChannel |
<nullable> |
The widget channel |
- Source:
GuildWidgetData
The Guild Widget object
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
enabled |
boolean | Whether the widget is enabled | |
channel |
GuildChannelResolvable |
<nullable> |
The widget channel |
- Source:
HTTPOptions
HTTP options
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
version |
number |
<optional> |
7 | API version to use |
api |
string |
<optional> |
'https://discord.com/api' | Base url of the API |
cdn |
string |
<optional> |
'https://cdn.discordapp.com' | Base url of the CDN |
invite |
string |
<optional> |
'https://discord.gg' | Base url of invites |
- Source:
ImageURLOptions
Options for Image URLs.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
format |
string |
<optional> |
One of `webp`, `png`, `jpg`, `jpeg`, `gif`. If no format is provided, defaults to `webp`. |
dynamic |
boolean |
<optional> |
If true, the format will dynamically change to `gif` for animated avatars; the default is false. |
size |
number |
<optional> |
One of `16`, `32`, `64`, `128`, `256`, `512`, `1024`, `2048`, `4096` |
- Source:
IntegrationAccount
The information account for an integration
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
string | The id of the account |
name |
string | The name of the account |
- Source:
IntegrationData
The data for creating an integration.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
string | The integration id |
type |
string | The integration type |
- Source:
IntegrationEditData
The data for editing an integration.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
expireBehavior |
number |
<optional> |
The new behaviour of expiring subscribers |
expireGracePeriod |
number |
<optional> |
The new grace period before expiring subscribers |
- Source:
IntentsResolvable
Data that can be resolved to give a permission number. This can be:
* A string (see Intents.FLAGS)
* An intents flag
* An instance of Intents
* An array of IntentsResolvable
Type:
- string | number | Intents | Array.<IntentsResolvable>
- Source:
InviteGenerationOptions
Options for Client#generateInvite.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
permissions |
PermissionResolvable |
<optional> |
Permissions to request |
guild |
GuildResolvable |
<optional> |
Guild to preselect |
disableGuildSelect |
boolean |
<optional> |
Whether to disable the guild selection |
- Source:
InviteResolvable
Data that can be resolved to give an invite code. This can be:
* An invite code
* An invite URL
Type:
- string
- Source:
MembershipStates
The value set for a team members's membership state:
* INVITED
* ACCEPTED
Type:
- string
- Source:
MessageActivity
Activity sent in a message.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
partyID |
string |
<optional> |
Id of the party represented in activity |
type |
number |
<optional> |
Type of activity sent |
- Source:
MessageAdditions
Additional items that can be sent with a message.
Type:
- MessageEmbed | MessageAttachment | Array.<(MessageEmbed|MessageAttachment)>
- Source:
MessageCollectorOptions
Type:
Properties:
Name | Type | Description |
---|---|---|
max |
number | The maximum amount of messages to collect |
maxProcessed |
number | The maximum amount of messages to process |
- Source:
MessageEditOptions
Options that can be passed into editMessage.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
content |
string |
<optional> |
Content to be edited |
embed |
MessageEmbed | Object |
<optional> |
An embed to be added/edited |
code |
string | boolean |
<optional> |
Language for optional codeblock formatting to apply |
allowedMentions |
MessageMentionOptions |
<optional> |
Which mentions should be parsed from the message content |
- Source:
MessageEmbedAuthor
Represents the author field of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
name |
string | The name of this author |
url |
string | URL of this author |
iconURL |
string | URL of the icon for this author |
proxyIconURL |
string | Proxied URL of the icon for this author |
- Source:
MessageEmbedFooter
Represents the footer field of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
text |
string | The text of this footer |
iconURL |
string | URL of the icon for this footer |
proxyIconURL |
string | Proxied URL of the icon for this footer |
- Source:
MessageEmbedImage
Represents the image of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
url |
string | URL for this image |
proxyURL |
string | ProxyURL for this image |
height |
number | Height of this image |
width |
number | Width of this image |
- Source:
MessageEmbedProvider
Represents the provider of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
name |
string | The name of this provider |
url |
string | URL of this provider |
- Source:
MessageEmbedThumbnail
Represents the thumbnail of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
url |
string | URL for this thumbnail |
proxyURL |
string | ProxyURL for this thumbnail |
height |
number | Height of this thumbnail |
width |
number | Width of this thumbnail |
- Source:
MessageEmbedVideo
Represents the video of a MessageEmbed
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
url |
string | URL of this video |
proxyURL |
string | ProxyURL for this video |
height |
number | Height of this video |
width |
number | Width of this video |
- Source:
MessageMentionOptions
Options provided to control parsing of mentions by Discord
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
parse |
Array.<MessageMentionTypes> |
<optional> |
Types of mentions to be parsed |
users |
Array.<Snowflake> |
<optional> |
Snowflakes of Users to be parsed as mentions |
roles |
Array.<Snowflake> |
<optional> |
Snowflakes of Roles to be parsed as mentions |
MessageMentionTypes
Types of mentions to enable in MessageMentionOptions.
- `roles`
- `users`
- `everyone`
Type:
- string
MessageOptions
Options provided when sending or editing a message.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tts |
boolean |
<optional> |
false | Whether or not the message should be spoken aloud |
nonce |
string |
<optional> |
'' | The nonce for the message |
content |
string |
<optional> |
'' | The content for the message |
embed |
MessageEmbed | Object |
<optional> |
An embed for the message (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details) | |
allowedMentions |
MessageMentionOptions |
<optional> |
Which mentions should be parsed from the message content | |
disableMentions |
DisableMentionType |
<optional> |
this.client.options.disableMentions | Whether or not all mentions or everyone/here mentions should be sanitized to prevent unexpected mentions |
files |
Array.<FileOptions> | Array.<BufferResolvable> |
<optional> |
Files to send with the message | |
code |
string | boolean |
<optional> |
Language for optional codeblock formatting to apply | |
split |
boolean | SplitOptions |
<optional> |
false | Whether or not the message should be split into multiple messages if it exceeds the character limit. If an object is provided, these are the options for splitting the message |
reply |
UserResolvable |
<optional> |
User to reply to (prefixes the message with a mention, except in DMs) |
MessageReactionResolvable
Data that can be resolved to a MessageReaction object. This can be:
* A MessageReaction
* A Snowflake
Type:
- Source:
MessageReference
Reference data sent in a crossposted message.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
channelID |
string | ID of the channel the message was crossposted from | |
guildID |
string |
<nullable> |
ID of the guild the message was crossposted from |
messageID |
string |
<nullable> |
ID of the message that was crossposted |
- Source:
MessageResolvable
Data that can be resolved to a Message object. This can be:
* A Message
* A Snowflake
Type:
- Source:
MessageTarget
A target for a message.
Type:
- TextChannel | DMChannel | User | GuildMember | Webhook | WebhookClient
- Source:
MessageType
The type of a message, e.g. `DEFAULT`. Here are the available types:
* DEFAULT
* RECIPIENT_ADD
* RECIPIENT_REMOVE
* CALL
* CHANNEL_NAME_CHANGE
* CHANNEL_ICON_CHANGE
* PINS_ADD
* GUILD_MEMBER_JOIN
* USER_PREMIUM_GUILD_SUBSCRIPTION
* USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1
* USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2
* USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3
* CHANNEL_FOLLOW_ADD
* GUILD_DISCOVERY_DISQUALIFIED
* GUILD_DISCOVERY_REQUALIFIED
Type:
- string
- Source:
OverwriteData
Data that can be used for a permission overwrite
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
GuildMemberResolvable | RoleResolvable | Member or role this overwrite is for | |
allow |
PermissionResolvable |
<optional> |
The permissions to allow |
deny |
PermissionResolvable |
<optional> |
The permissions to deny |
type |
OverwriteType |
<optional> |
The type of this OverwriteData |
OverwriteResolvable
Data that can be resolved into RawOverwriteData
Type:
OverwriteType
The type of a permission overwrite. It can be one of:
* member
* role
Type:
- string
PartialChannelData
Partial data for a Channel.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
number |
<optional> |
The ID for this channel, used to set its parent, this is a placeholder and will be replaced by the API after consumption |
parentID |
number |
<optional> |
The parent ID for this channel |
type |
string |
<optional> |
The type of the channel |
name |
string | The name of the channel | |
topic |
string |
<optional> |
The topic of the text channel |
nsfw |
boolean |
<optional> |
Whether the channel is NSFW |
bitrate |
number |
<optional> |
The bitrate of the voice channel |
userLimit |
number |
<optional> |
The user limit of the channel |
permissionOverwrites |
PartialOverwriteData |
<optional> |
Overwrites of the channel |
rateLimitPerUser |
number |
<optional> |
The rate limit per user of the channel in seconds |
- Source:
PartialOverwriteData
Partial overwrite data.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
number | Snowflake | The Role or User ID for this overwrite | |
type |
string |
<optional> |
The type of this overwrite |
allow |
PermissionResolvable |
<optional> |
The permissions to allow |
deny |
PermissionResolvable |
<optional> |
The permissions to deny |
- Source:
PartialRoleData
Partial data for a Role.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
number |
<optional> |
The ID for this role, used to set channel overrides, this is a placeholder and will be replaced by the API after consumption |
name |
string |
<optional> |
The name of the role |
color |
ColorResolvable |
<optional> |
The color of the role, either a hex string or a base 10 number |
hoist |
boolean |
<optional> |
Whether or not the role should be hoisted |
position |
number |
<optional> |
The position of the role |
permissions |
PermissionResolvable | number |
<optional> |
The permissions of the role |
mentionable |
boolean |
<optional> |
Whether or not the role should be mentionable |
- Source:
PartialType
The type of Structure allowed to be a partial:
* USER
* CHANNEL (only affects DMChannels)
* GUILD_MEMBER
* MESSAGE
* REACTION
Partials require you to put checks in place when handling data, read the Partials topic listed in the
sidebar for more information.
Type:
- string
- Source:
PermissionOverwriteOptions
An object mapping permission flags to `true` (enabled), `null` (unset) or `false` (disabled).
```js
{
'SEND_MESSAGES': true,
'EMBED_LINKS': null,
'ATTACH_FILES': false,
}
```
Type:
- Object
PermissionResolvable
Data that can be resolved to give a permission number. This can be:
* A string (see Permissions.FLAGS)
* A permission number
* An instance of Permissions
* An Array of PermissionResolvable
Type:
- string | number | Permissions | Array.<PermissionResolvable>
- Source:
PremiumTier
The type of premium tier:
* 0: NONE
* 1: TIER_1
* 2: TIER_2
* 3: TIER_3
Type:
- number
- Source:
PresenceData
Data resembling a raw Discord presence.
Type:
- Object
Properties:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
status |
PresenceStatusData |
<optional> |
Status of the user | ||||||||||||||||||||||||||||
afk |
boolean |
<optional> |
Whether the user is AFK | ||||||||||||||||||||||||||||
activity |
Object |
<optional> |
Activity the user is playing
Properties
|
||||||||||||||||||||||||||||
shardID |
number | Array.<number> |
<optional> |
Shard Id(s) to have the activity set on |
- Source:
PresenceResolvable
Data that can be resolved to a Presence object. This can be:
* A Presence
* A UserResolvable
* A Snowflake
Type:
- Source:
PresenceStatus
The status of this presence:
* **`online`** - user is online
* **`idle`** - user is AFK
* **`offline`** - user is offline or invisible
* **`dnd`** - user is in Do Not Disturb
Type:
- string
- Source:
PresenceStatusData
A user's status. Must be one of:
* `online`
* `idle`
* `invisible`
* `dnd` (do not disturb)
Type:
- string
- Source:
RawOverwriteData
The raw data for a permission overwrite
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
Snowflake | The id of the overwrite |
allow |
number | The permissions to allow |
deny |
number | The permissions to deny |
type |
OverwriteType | The type of this OverwriteData |
ReactionCollectorOptions
Type:
Properties:
Name | Type | Description |
---|---|---|
max |
number | The maximum total amount of reactions to collect |
maxEmojis |
number | The maximum number of emojis to collect |
maxUsers |
number | The maximum number of users to react |
ReceiveStreamOptions
Options passed to `VoiceReceiver#createStream`.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
mode |
string |
<optional> |
'opus' | The mode for audio output. This defaults to opus, meaning discord.js won't decode the packets for you. You can set this to 'pcm' so that the stream's output will be 16-bit little-endian stereo audio |
end |
string |
<optional> |
'silence' | When the stream should be destroyed. If `silence`, this will be when the user stops talking. Otherwise, if `manual`, this should be handled by you. |
ResolvedOverwriteOptions
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
allow |
Permissions | The allowed permissions |
deny |
Permissions | The denied permissions |
RoleData
The data for a role.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string |
<optional> |
The name of the role |
color |
ColorResolvable |
<optional> |
The color of the role, either a hex string or a base 10 number |
hoist |
boolean |
<optional> |
Whether or not the role should be hoisted |
position |
number |
<optional> |
The position of the role |
permissions |
PermissionResolvable |
<optional> |
The permissions of the role |
mentionable |
boolean |
<optional> |
Whether or not the role should be mentionable |
- Source:
RoleResolvable
Data that can be resolved to a Role object. This can be:
* A Role
* A Snowflake
Type:
- Source:
ShardingManagerMode
The mode to spawn shards with for a ShardingManager: either "process" to use child processes, or
"worker" to use [Worker threads](https://nodejs.org/api/worker_threads.html).
Type:
- Object
- Source:
Snowflake
A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z
```
If we have a snowflake '266241948824764416' we can represent it as binary:
64 22 17 12 0
000000111011000111100001101001000101000000 00001 00000 000000000000
number of ms since Discord epoch worker pid increment
```
Type:
- string
- Source:
SplitOptions
Options for splitting a message.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
maxLength |
number |
<optional> |
2000 | Maximum character length per message piece |
char |
string |
<optional> |
'\n' | Character to split the message with |
prepend |
string |
<optional> |
'' | Text to prepend to every piece except the first |
append |
string |
<optional> |
'' | Text to append to every piece except the last |
Status
The current status of the client. Here are the available statuses:
* READY: 0
* CONNECTING: 1
* RECONNECTING: 2
* IDLE: 3
* NEARLY: 4
* DISCONNECTED: 5
* WAITING_FOR_GUILDS: 6
* IDENTIFYING: 7
* RESUMING: 8
Type:
- number
- Source:
StreamOptions
Options that can be passed to stream-playing methods:
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
StreamType |
<optional> |
'unknown' | The type of stream. |
seek |
number |
<optional> |
0 | The time to seek to, will be ignored when playing `ogg/opus` or `webm/opus` streams |
volume |
number | boolean |
<optional> |
1 | The volume to play at. Set this to false to disable volume transforms for this stream to improve performance. |
plp |
number |
<optional> |
Expected packet loss percentage | |
fec |
boolean |
<optional> |
Enabled forward error correction | |
bitrate |
number | string |
<optional> |
96 | The bitrate (quality) of the audio in kbps. If set to 'auto', the voice channel's bitrate will be used |
highWaterMark |
number |
<optional> |
12 | The maximum number of opus packets to make and store before they are actually needed. See https://nodejs.org/en/docs/guides/backpressuring-in-streams/. Setting this value to 1 means that changes in volume will be more instant. |
StreamType
An option passed as part of `StreamOptions` specifying the type of the stream.
* `unknown`: The default type, streams/input will be passed through to ffmpeg before encoding.
Will play most streams.
* `converted`: Play a stream of 16bit signed stereo PCM data, skipping ffmpeg.
* `opus`: Play a stream of opus packets, skipping ffmpeg. You lose the ability to alter volume.
* `ogg/opus`: Play an ogg file with the opus encoding, skipping ffmpeg. You lose the ability to alter volume.
* `webm/opus`: Play a webm file with opus audio, skipping ffmpeg. You lose the ability to alter volume.
Type:
- string
StringResolvable
Data that can be resolved to give a string. This can be:
* A string
* An array (joined with a new line delimiter to give a string)
* Any value
Type:
- string | Array | *
- Source:
SystemChannelFlagsResolvable
Data that can be resolved to give a sytem channel flag bitfield. This can be:
* A string (see SystemChannelFlags.FLAGS)
* A sytem channel flag
* An instance of SystemChannelFlags
* An Array of SystemChannelFlagsResolvable
Type:
- string | number | SystemChannelFlags | Array.<SystemChannelFlagsResolvable>
- Source:
TargetUser
The type of the target user:
* 1: STREAM
Type:
- number
- Source:
UserResolvable
Data that resolves to give a User object. This can be:
* A User object
* A Snowflake
* A Message object (resolves to the message author)
* A GuildMember object
Type:
- User | Snowflake | Message | GuildMember
- Source:
Vanity
An object containing information about a guild's vanity invite.
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
code |
string |
<nullable> |
Vanity invite code |
uses |
number |
<nullable> |
How many times this invite has been used |
- Source:
VerificationLevel
The value set for the verification levels for a guild:
* NONE
* LOW
* MEDIUM
* HIGH
* VERY_HIGH
Type:
- string
- Source:
VoiceStatus
The current status of a voice connection. Here are the available statuses:
* CONNECTED: 0
* CONNECTING: 1
* AUTHENTICATING: 2
* RECONNECTING: 3
* DISCONNECTED: 4
Type:
- number
- Source:
WebhookMessageOptions
Options that can be passed into send.
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
username |
string |
<optional> |
this.name | Username override for the message |
avatarURL |
string |
<optional> |
Avatar URL override for the message | |
tts |
boolean |
<optional> |
false | Whether or not the message should be spoken aloud |
nonce |
string |
<optional> |
'' | The nonce for the message |
embeds |
Array.<Object> |
<optional> |
An array of embeds for the message | |
allowedMentions |
MessageMentionOptions |
<optional> |
Which mentions should be parsed from the message content (see [here](https://discord.com/developers/docs/resources/channel#embed-object) for more details) | |
disableMentions |
DisableMentionType |
<optional> |
this.client.options.disableMentions | Whether or not all mentions or everyone/here mentions should be sanitized to prevent unexpected mentions |
files |
Array.<FileOptions> | Array.<string> |
<optional> |
Files to send with the message | |
code |
string | boolean |
<optional> |
Language for optional codeblock formatting to apply | |
split |
boolean | SplitOptions |
<optional> |
false | Whether or not the message should be split into multiple messages if it exceeds the character limit. If an object is provided, these are the options for splitting the message. |
- Source:
WebhookTypes
The value set for a webhook's type:
* Incoming
* Channel Follower
Type:
- string
- Source:
WebsocketOptions
WebSocket options (these are left as snake_case to match the API)
Type:
- Object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
large_threshold |
number |
<optional> |
50 | Number of members in a guild after which offline users will no longer be sent in the initial guild member list, must be between 50 and 250 |
intents |
IntentsResolvable |
<optional> |
Intents to enable for this connection |
- Source:
WSEventType
The type of a websocket message event, e.g. `MESSAGE_CREATE`. Here are the available events:
* READY
* RESUMED
* GUILD_CREATE
* GUILD_DELETE
* GUILD_UPDATE
* INVITE_CREATE
* INVITE_DELETE
* GUILD_MEMBER_ADD
* GUILD_MEMBER_REMOVE
* GUILD_MEMBER_UPDATE
* GUILD_MEMBERS_CHUNK
* GUILD_INTEGRATIONS_UPDATE
* GUILD_ROLE_CREATE
* GUILD_ROLE_DELETE
* GUILD_ROLE_UPDATE
* GUILD_BAN_ADD
* GUILD_BAN_REMOVE
* GUILD_EMOJIS_UPDATE
* CHANNEL_CREATE
* CHANNEL_DELETE
* CHANNEL_UPDATE
* CHANNEL_PINS_UPDATE
* MESSAGE_CREATE
* MESSAGE_DELETE
* MESSAGE_UPDATE
* MESSAGE_DELETE_BULK
* MESSAGE_REACTION_ADD
* MESSAGE_REACTION_REMOVE
* MESSAGE_REACTION_REMOVE_ALL
* MESSAGE_REACTION_REMOVE_EMOJI
* USER_UPDATE
* PRESENCE_UPDATE
* TYPING_START
* VOICE_STATE_UPDATE
* VOICE_SERVER_UPDATE
* WEBHOOKS_UPDATE
Type:
- string
- Source: