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);
Info
  • Requires the MANAGE_CHANNELS permission for the guild, or MANAGE_THREADS if the channel is a thread.
  • For Community guilds, the Rules or Guidelines channel and the Community Updates channel cannot be deleted.
Warning

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);
Info
  • Only usable for guild channels.
  • Requires the MANAGE_ROLES permission.
  • Only permissions your bot has in the guild or parent channel (if applicable) can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite 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);
Info
  • Only usable for guild channels.
  • Requires the MANAGE_CHANNELS permission.

Create Channel Invite

PostAPIChannelInvite

Create a new invite object for the channel.

import { createChannelInvite } from "dressed";
await createChannelInvite(channelId, data);
Info
  • Only usable for guild channels.
  • Requires the CREATE_INSTANT_INVITE permission.

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);
Info
  • Only usable for guild channels.
  • Requires the MANAGE_ROLES permission.

Follow Channel

PostAPIChannelFollowers

Follow an Announcement Channel to send messages to a target channel.

import { followChannel } from "dressed";
await followChannel(channelId, data);
Info

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);
Info

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?);
Info
  • When called on a GUILD_TEXT channel, creates a PUBLIC_THREAD. When called on a GUILD_ANNOUNCEMENT channel, creates a ANNOUNCEMENT_THREAD.
  • Does not work on a GUILD_FORUM or a GUILD_MEDIA channel.
  • 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);
Info
  • The type of the created thread is PUBLIC_THREAD.
  • The current user must have the SEND_MESSAGES permission (CREATE_PUBLIC_THREADS is 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?);
Info

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?);
Info
  • 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?);
Info

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?);
Info

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.

Warning
  • Starting in API v11, this endpoint will always return paginated results. Paginated results can be enabled before API v11 by setting with_member to true. Read the changelog for details.
  • This endpoint is restricted according to whether the GUILD_MEMBERS Privileged 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?);