Channel
Get Channel
GetAPIChannel
Get a channel by ID.
import { getChannel } from "dressed";
const channel = await getChannel(channelId);Modify Channel
PatchAPIChannel
Update a channel's settings.
import { modifyChannel } from "dressed";
await modifyChannel(channelId, data);Delete Channel
DeleteAPIChannel
Delete a channel, or close a private message.
import { deleteChannel } from "dressed";
await deleteChannel(channelId);- Requires the
MANAGE_CHANNELSpermission for the guild, orMANAGE_THREADSif the channel is a thread. - For Community guilds, the Rules or Guidelines channel and the Community Updates channel cannot be deleted.
Deleting a guild channel cannot be undone. Use this with caution, as it is impossible to undo this action when performed on a guild channel. In contrast, when used with a private message, it is possible to undo the action by opening a private message with the recipient again.
Modify Channel Permissions
PutAPIChannelPermission
Edit the channel permission overwrites for a user or role in a channel.
import { modifyChannelPermissions } from "dressed";
await modifyChannelPermissions(channelId, overwriteId);- Only usable for guild channels.
- Requires the
MANAGE_ROLESpermission. - Only permissions your bot has in the guild or parent channel (if applicable) can be allowed/denied (unless your bot has a
MANAGE_ROLESoverwrite in the channel).
List Channel Invites
GetAPIChannelInvites
Returns a list of invite objects (with invite metadata) for the channel.
import { listChannelInvites } from "dressed";
const channelInvites = await listChannelInvites(channelId);- Only usable for guild channels.
- Requires the
MANAGE_CHANNELSpermission.
Create Channel Invite
PostAPIChannelInvite
Create a new invite object for the channel.
import { createChannelInvite } from "dressed";
await createChannelInvite(channelId, data);- Only usable for guild channels.
- Requires the
CREATE_INSTANT_INVITEpermission.
Delete Channel Permissions
DeleteAPIChannelPermission
Delete a channel permission overwrite for a user or role in a channel.
- TODO rename to something like
deleteChannelPermission
import { deleteChannelPermissions } from "dressed";
await deleteChannelPermissions(channelId, overwriteId);- Only usable for guild channels.
- Requires the
MANAGE_ROLESpermission.
Follow Channel
PostAPIChannelFollowers
Follow an Announcement Channel to send messages to a target channel.
import { followChannel } from "dressed";
await followChannel(channelId, data);Requires the MANAGE_WEBHOOKS permission in the target channel.
Create Typing Indicator
PostAPIChannelTyping
Post a typing indicator for the specified channel, which expires after 10 seconds.
import { createTypingIndicator } from "dressed";
await createTypingIndicator(channelId);Generally bots should not use this route.
Add GDM Member
PutAPIChannelRecipient
Adds a recipient to a Group DM using their access token.
import { addGDMMember } from "dressed";
await addGDMMember(channelId, userId);Remove GDM Member
DeleteAPIChannelRecipient
Removes a recipient from a Group DM.
import { removeGDMMember } from "dressed";
await removeGDMMember(channelId, userId);Create Thread
PostAPIChannelThreads
Creates a new thread, include a message ID to start the thread from an existing message.
import { createThread } from "dressed";
await createThread(channelId, data, messageId?);- When called on a
GUILD_TEXTchannel, creates aPUBLIC_THREAD. When called on aGUILD_ANNOUNCEMENTchannel, creates aANNOUNCEMENT_THREAD. - Does not work on a
GUILD_FORUMor aGUILD_MEDIAchannel. - The id of the created thread will be the same as the id of the source message, and as such a message can only have a single thread created from it.
Create Forum Thread
PostAPIGuildForumThreads
Creates a new thread in a forum or a media channel, and sends a message within the created thread.
import { createForumThread } from "dressed";
await createForumThread(channelId, data);- The type of the created thread is
PUBLIC_THREAD. - The current user must have the
SEND_MESSAGESpermission (CREATE_PUBLIC_THREADSis ignored).
Add Thread Member
PutAPIChannelThreadMembers
Adds a member to a thread.
- @param userId Member to add, defaults to self
import { addThreadMember } from "dressed";
await addThreadMember(threadId, userId?);Adding another member requires the ability to send messages in the thread.
Remove Thread Member
DeleteAPIChannelThreadMembers
Removes a member from a thread.
- @param userId Member to remove, defaults to self
import { removeThreadMember } from "dressed";
await removeThreadMember(threadId, userId?);- Requires the ability to send messages in the thread.
- Removing another member also requires the thread is not archived.
Get Thread Member
GetAPIChannelThreadMember
Returns a thread member object for the specified user if they are a member of the thread.
import { getThreadMember } from "dressed";
const threadMember = await getThreadMember(threadId, userId, params?);When with_member is set to true, the thread member object will include a member field containing a guild member object.
List Thread Members
GetAPIChannelThreadMembers
Returns array of thread members objects that are members of the thread.
import { listThreadMembers } from "dressed";
const threadMembers = await listThreadMembers(threadId, params?);When with_member is set to true, the results will be paginated and each thread member object will include a member field containing a guild member object.
- Starting in API v11, this endpoint will always return paginated results. Paginated results can be enabled before API v11 by setting
with_membertotrue. Read the changelog for details. - This endpoint is restricted according to whether the
GUILD_MEMBERSPrivileged Intent is enabled for your application.
List Archived Threads
GetAPIChannelThreadsArchived
Returns a list of archived threads in the channel. Alternatively, returns a list of joined private threads in the channel.
import { listArchivedThreads } from "dressed";
const archivedThreads = await listArchivedThreads(channelId, archivedStatus, joinedOnly?, params?);