Skip to main content
The methods that create or change something take an options object. Its fields are the ones of Discord, written in camelCase; your editor completes them.
These options belong to the actions of Guild, the channels and Role. What a message takes is in Message options, what a member takes in GuildMember.
A few rules hold everywhere:
  • When editing, only what you pass changes. null removes a value where the type allows it.
  • Images are data URIs: data:image/png;base64,....
  • Ids are Snowflakes: the id of a structure, or the text copied from Discord.
  • Permissions are written by name ('ManageThreads'), never as numbers: see Permissions.

GuildEditOptions

What edit() takes on a server: only what is passed changes. Images are data URIs (data:image/png;base64,...).
string
The name of the server.
VerificationLevel | null
What Discord asks of new members before they can write: a value of VerificationLevel.
DefaultMessageNotificationLevel | null
Whether members get a notification for every message or only when they are mentioned, by default: a value of DefaultMessageNotificationLevel.
ExplicitContentFilterLevel | null
Whose images and videos Discord scans for explicit content: a value of ExplicitContentFilterLevel.
Snowflake | null
The id of the voice channel inactive members are moved to.
number
After how many seconds of inactivity a member is moved there: 60, 300, 900, 1800 or 3600.
string | null
The icon: a 1024x1024 PNG, JPEG or GIF (an animated GIF only when the server has the ANIMATED_ICON feature).
string | null
The background of the invite page: a 16:9 PNG or JPEG (when the server has the INVITE_SPLASH feature).
string | null
The background shown in server discovery: a 16:9 PNG or JPEG (when the server has the DISCOVERABLE feature).
string | null
The banner: a 16:9 PNG or JPEG (when the server has the BANNER feature; an animated GIF when it has the ANIMATED_BANNER feature).
Snowflake | null
The id of the channel where Discord posts welcome messages and boost notices.
number
Which of those notices are hidden, as a bit field.
Snowflake | null
The id of the channel that shows the rules, in a community server.
Snowflake | null
The id of the channel where the admins and moderators of a community server receive notices from Discord.
Locale | null
The language of a community server, used in server discovery and in the notices Discord sends; 'en-US' by default. A value of Locale.
GuildFeature[]
The features enabled on the server: see GuildFeature.
string | null
The description of the server.
boolean
Whether the boost progress bar is shown.
Snowflake | null
The id of the channel where the admins and moderators of a community server receive safety alerts from Discord.
Discord documentation

ChannelCreateOptions

What createChannel() takes: a name, a type, and the settings of that kind of channel.
Only name is needed: without a type, Discord creates a text channel. The other fields only apply to the kind of channel they describe.
string
required
The name of the channel (1-100 characters).
ChannelType | null
The kind of channel: a value of ChannelType.
string | null
The topic shown at the top of the channel (0-1024 characters).
number | null
The audio quality of a voice or stage channel, in bits per second; 8000 at least.
number | null
How many people can join a voice channel.
number | null
Slowmode: how many seconds a member waits between two messages (0-21600). Bots and members with the BypassSlowmode permission are not affected.
number | null
Where the channel is in the list (channels with the same position are sorted by id).
object[] | null
What roles and members are allowed or denied in the channel.
Snowflake | null
The id of the category to put the channel in.
boolean | null
Whether the channel is age-restricted.
string | null
The voice region of a voice or stage channel; null lets Discord pick it.
VideoQualityMode | null
The camera quality of a voice channel: a value of VideoQualityMode.
number | null
After how many minutes without activity the Discord app suggests archiving a new thread of the channel.
object | null
The emoji of the “add reaction” button on the posts of a forum or media channel.
ForumTag[] | null
The tags the posts of a forum or media channel can have: see ForumTag. A new tag has no id yet: Discord gives it one.
ForumSortOrderType | null
How the posts of a forum or media channel are ordered: a value of ForumSortOrderType.
ForumLayoutType | null
How the posts of a forum are displayed: a value of ForumLayoutType.
number | null
The slowmode given to new threads of the channel. It is copied when the thread is created and does not follow later changes.
number | null
The flags of the channel, as a bit field.
Discord documentation

GuildChannelEditOptions

What edit() takes on a channel of a server.
It works on every channel of a server that is not a thread: text, voice, category and forum channels. A field that does not apply to the kind of channel is refused by Discord.
string
The name of the channel (1-100 characters).
ChannelType
The kind of channel: a value of ChannelType. Only a text channel can become an announcement channel and back, in a server that has the NEWS feature.
number | null
Where the channel is in the list (channels with the same position are sorted by id).
string | null
The topic shown at the top of the channel: 0-1024 characters, or 0-4096 for a forum or media channel.
boolean | null
Whether the channel is age-restricted.
number | null
Slowmode: how many seconds a member waits between two messages (0-21600). Bots and members with the BypassSlowmode permission are not affected.
number | null
The audio quality of a voice or stage channel, in bits per second; 8000 at least.
number | null
How many people can join: up to 99 in a voice channel, 10,000 in a stage channel; 0 means no limit.
object[] | null
What roles and members are allowed or denied in the channel or the category: the same objects as in ChannelCreateOptions.
Snowflake | null
The id of the category to move the channel to.
string | null
The voice region of the channel; null lets Discord pick it.
VideoQualityMode | null
The camera quality of a voice channel: a value of VideoQualityMode.
number | null
After how many minutes without activity the Discord app suggests archiving a new thread of the channel.
number
The flags of the channel, as a bit field.
ForumTag[]
The tags the posts of a forum or media channel can have, 20 at most: see ForumTag. A tag without id is a new one; the others keep theirs.
object | null
The emoji of the “add reaction” button on the posts of a forum or media channel: { emojiId, emojiName }, as in ChannelCreateOptions.
number
The slowmode given to new threads of the channel. It is copied when the thread is created and does not follow later changes.
ForumSortOrderType | null
How the posts of a forum or media channel are ordered: a value of ForumSortOrderType.
ForumLayoutType
How the posts of a forum are displayed: a value of ForumLayoutType.
Discord documentation

ThreadCreateOptions

What startThread() takes on a text channel.
To start a thread from a message, use message.startThread() instead: see Message.
string
required
The name of the thread (1-100 characters).
number
After how many minutes without activity the thread leaves the channel list: 60, 1440, 4320 or 10080.
ChannelType
The kind of thread: ChannelType.PublicThread, ChannelType.PrivateThread or ChannelType.AnnouncementThread (see ChannelType).
boolean
Whether members who are not moderators can add other members to the thread. Only for a private thread.
number | null
Slowmode: how many seconds a member waits between two messages (0-21600).
Discord documentation

ThreadEditOptions

What edit() takes on a thread.
thread.archive() and thread.unarchive() are shortcuts for { archived: true } and { archived: false }.
string
The name of the thread (1-100 characters).
boolean
Whether the thread is archived.
number
After how many minutes without activity the thread leaves the channel list: 60, 1440, 4320 or 10080.
boolean
Whether the thread is locked: only members with the ManageThreads permission can then unarchive it.
boolean
Whether members who are not moderators can add other members to the thread. Only for a private thread.
number | null
Slowmode: how many seconds a member waits between two messages (0-21600). Bots and members with the BypassSlowmode permission are not affected.
number
The flags of the thread, as a bit field. Only a post of a forum or media channel can be pinned this way.
Snowflake[]
The ids of the tags of a post of a forum or media channel, 5 at most.
Discord documentation

ForumPostOptions

What createPost() takes.
string
required
The title of the post.
MessageInput
required
The first message of the post: a text, or everything a message can contain (see MessageInput).
Snowflake[]
The ids of the tags of the post.
60 | 1440 | 4320 | 10080
After how many minutes without activity the post is archived.
number
Slowmode of the post, in seconds.
The message is checked like any other before it is sent: see Message options. Discord documentation

RoleCreateOptions

What createRole() takes. Permissions are given by name, as a list of names or as a Permissions set.
Every field can be left out: guild.createRole() creates a role with the defaults of Discord.
string
The name of the role, 100 characters at most.
PermissionResolvable | string
What the role allows: a name, a list of names, a Permissions set, or the text Discord uses. See PermissionResolvable.
object
The colors of the role.
boolean
Whether members with the role are shown apart in the member list.
string | null
The icon of the role, as a data URI (when the server has the ROLE_ICONS feature).
string | null
A standard emoji shown as the icon of the role (when the server has the ROLE_ICONS feature).
boolean
Whether everyone can mention the role.
Discord documentation

RoleEditOptions

What edit() takes on a role: only what is passed changes. Permissions are given by name, as a list of names or as a Permissions set.
string
The name of the role, 100 characters at most.
PermissionResolvable | string
What the role allows: a name, a list of names, a Permissions set, or the text Discord uses. It replaces the permissions of the role: start from role.permissions.add() or .remove() to change one. See PermissionResolvable.
object
The colors of the role: { primaryColor, secondaryColor, tertiaryColor }, as in RoleCreateOptions.
boolean
Whether members with the role are shown apart in the member list.
string
The icon of the role, as a data URI (when the server has the ROLE_ICONS feature).
string
A standard emoji shown as the icon of the role (when the server has the ROLE_ICONS feature).
boolean
Whether everyone can mention the role.
Discord documentation

InviteCreateOptions

What createInvite() takes.
Every field can be left out: channel.createInvite() creates an invite with the defaults of Discord.
number
After how many seconds the invite expires, from 0 (never) to 604800 (7 days).
number
How many times it can be used, from 0 (no limit) to 100.
boolean
Whether the invite only grants a temporary membership: members who join with it are kicked when they go offline.
boolean
true to always create a new link, instead of reusing a similar one that already exists. Useful for many one-time links.
1 | 2
What a voice channel invite opens: 1 a stream, 2 an embedded activity.
Snowflake
The id of the user whose stream to show. Needed when targetType is 1; the user must be streaming in the channel.
Snowflake
The id of the activity to open. Needed when targetType is 2; the application must have the EMBEDDED flag.
Snowflake[]
The ids of the only users who can see and accept the invite, 1000 at most.
Snowflake[]
The ids of the roles given to whoever joins with the invite.
Discord documentation

FetchMessagesOptions

What fetchMessages() takes: how many messages, and from where.
number
How many messages, from 1 to 100. Default: 50.
Snowflake | { id: Snowflake }
Only messages before this one.
Snowflake | { id: Snowflake }
Only messages after this one.
Snowflake | { id: Snowflake }
Messages around this one.
limit is checked before anything is sent. A wrong one throws a RangeError:
To start from a date rather than from a message, turn the date into an id with snowflakeFromTimestamp(). Discord documentation