Guild

Get Guild

GetAPIGuild

Returns the guild object for the given id.

import { getGuild } from "dressed";
const guild = await getGuild(guildId, params?);
Info

If with_counts is set to true, this endpoint will also return approximate_member_count and approximate_presence_count for the guild.

Get Guild Preview

GetAPIGuildPreview

Returns the guild preview object for the given id.

import { getGuildPreview } from "dressed";
const guildPreview = await getGuildPreview(guildId);
Info

If the user is not in the guild, then the guild must be discoverable.

Modify Guild

PatchAPIGuild

Modify a guild's settings.

import { modifyGuild } from "dressed";
await modifyGuild(guildId, data);
Info

Requires the MANAGE_GUILD permission.

Warning

Attempting to add or remove the COMMUNITY guild feature requires the ADMINISTRATOR permission.

List Channels

GetAPIGuildChannels

Returns a list of guild channel objects.

import { listChannels } from "dressed";
const channels = await listChannels(guildId);
Info

Does not include threads.

Create Channel

PostAPIGuildChannel

Create a new channel object for the guild.

import { createChannel } from "dressed";
await createChannel(guildId, data);
Info
  • Requires the MANAGE_CHANNELS permission. If setting permission overwrites, only permissions your bot has in the guild can be allowed/denied.
  • Setting MANAGE_ROLES permission in channels is only possible for guild administrators.

Modify Channel Positions

PatchAPIGuildChannelPositions

Modify the positions of a set of channel objects for the guild.

import { modifyChannelPositions } from "dressed";
await modifyChannelPositions(guildId, data);
Info
  • Requires the MANAGE_GUILD permission.
  • Only channels to be modified are required.

List Active Threads

GetAPIGuildThreads

Returns all active threads in the guild, including public and private threads.

import { listActiveThreads } from "dressed";
const activeThreads = await listActiveThreads(guildId);
Info

Threads are ordered by their id, in descending order.

Get Member

GetAPIGuildMember

Returns a guild member object for the specified user.

import { getMember } from "dressed";
const member = await getMember(guildId, userId);

List Members

GetAPIGuildMembers

Returns a list of guild member objects that are members of the guild.

import { listMembers } from "dressed";
const members = await listMembers(guildId, params?);
Warning

This endpoint is restricted according to whether the GUILD_MEMBERS Privileged Intent is enabled for your application.

Search Members

GetAPIGuildMembersSearch

Returns a list of guild member objects whose username or nickname starts with a provided string.

import { searchMembers } from "dressed";
const members = await searchMembers(guildId, params?);

Add Member

PutAPIGuildMember

Adds a user to the guild, provided you have a valid oauth2 access token for the user with the guilds.join scope.

import { addMember } from "dressed";
await addMember(guildId, userId, data);
Info

The Authorization header must be a Bot token (belonging to the same application used for authorization), and the bot must be a member of the guild with CREATE_INSTANT_INVITE permission.

Modify Member

PatchAPIGuildMember

Modify attributes of a guild member, defaults to self.

import { modifyMember } from "dressed";
await modifyMember(guildId, userId, data);

Add Member Role

PutAPIGuildMemberRole

Adds a role to a guild member.

import { addMemberRole } from "dressed";
await addMemberRole(guildId, userId, roleId);
Info

Requires the MANAGE_ROLES permission.

Remove Member Role

DeleteAPIGuildMemberRole

Removes a role from a guild member.

import { removeMemberRole } from "dressed";
await removeMemberRole(guildId, userId, roleId);
Info

Requires the MANAGE_ROLES permission.

Remove Member

DeleteAPIGuildMember

Remove a member from a guild.

import { removeMember } from "dressed";
await removeMember(guildId, userId);
Info

Requires KICK_MEMBERS permission.

List Bans

GetAPIGuildBans

Returns a list of ban objects for the users banned from this guild.

import { listBans } from "dressed";
const bans = await listBans(guildId, params?);
Info

Requires BAN_MEMBERS permission.

Get Ban

GetAPIGuildBan

Returns a ban object for the given user or a 404 not found if the ban cannot be found.

import { getBan } from "dressed";
const ban = await getBan(guildId, userId);
Info

Requires BAN_MEMBERS permission.

Create Ban

PutAPIGuildBan

Create a guild ban, and optionally delete previous messages sent by the banned user.

import { createBan } from "dressed";
await createBan(guildId, userId, data);
Info

Requires BAN_MEMBERS permission.

Delete Ban

DeleteAPIGuildBan

Remove the ban for a user.

import { deleteBan } from "dressed";
await deleteBan(guildId, userId);
Info

Requires BAN_MEMBERS permission.

Bulk Create Ban

PostAPIGuildBulkBan

Ban up to 200 users from a guild, and optionally delete previous messages sent by the banned users.

import { bulkCreateBan } from "dressed";
await bulkCreateBan(guildId, data);
Info
  • Requires both the BAN_MEMBERS and MANAGE_GUILD permissions.
  • If none of the users could be banned, an error response code 500000: Failed to ban users is returned instead.

List Roles

GetAPIGuildRoles

Returns a list of role objects for the guild.

import { listRoles } from "dressed";
const roles = await listRoles(guildId);

Get Role

GetAPIGuildRole

Returns a role object for the specified role.

import { getRole } from "dressed";
const role = await getRole(guildId, roleId);

Create Role

PostAPIGuildRole

Create a new role for the guild.

import { createRole } from "dressed";
await createRole(guildId, data);
Info

Requires the MANAGE_ROLES permission.

Modify Role Positions

PatchAPIGuildRolePositions

Modify the positions of a set of role objects for the guild.

import { modifyRolePositions } from "dressed";
await modifyRolePositions(guildId, data);
Info

Requires the MANAGE_ROLES permission.

Modify Role

PatchAPIGuildRole

Modify a guild role.

import { modifyRole } from "dressed";
await modifyRole(guildId, roleId, data);
Info

Requires the MANAGE_ROLES permission.

Delete Role

DeleteAPIGuildRole

Delete a guild role.

import { deleteRole } from "dressed";
await deleteRole(guildId, roleId);
Info

Requires the MANAGE_ROLES permission.

Get Prune Count

GetAPIGuildPruneCount

Returns an object with one pruned key indicating the number of members that would be removed in a prune operation.

import { getPruneCount } from "dressed";
const pruneCount = await getPruneCount(guildId, params?);
Info

By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be counted in the prune and users with additional roles will not.

Start Prune

PostAPIGuildPrune

Begin a prune operation.

import { startPrune } from "dressed";
await startPrune(guildId, data);
Info
  • Requires the MANAGE_GUILD and KICK_MEMBERS permissions.
  • By default, prune will not remove users with roles. You can optionally include specific roles in your prune by providing the include_roles parameter. Any inactive user that has a subset of the provided role(s) will be included in the prune and users with additional roles will not.

List Guild Voice Regions

GetAPIGuildVoiceRegions

Returns a list of voice region objects for the guild.

import { listGuildVoiceRegions } from "dressed";
const guildVoiceRegions = await listGuildVoiceRegions(guildId);
Info

Unlike the similar /voice route, this returns VIP servers when the guild is VIP-enabled.

List Invites

GetAPIGuildInvites

Returns a list of invite objects.

import { listInvites } from "dressed";
const invites = await listInvites(guildId);
Info
  • Requires the MANAGE_GUILD or VIEW_AUDIT_LOG permission.
  • Invite Metadata is included with the MANAGE_GUILD permission.

List Integrations

GetAPIGuildIntegrations

Returns a list of integration objects for the guild.

import { listIntegrations } from "dressed";
const integrations = await listIntegrations(guildId);
Info
  • Requires the MANAGE_GUILD permission.
  • This endpoint returns a maximum of 50 integrations. If a guild has more integrations, they cannot be accessed.

Delete Integration

DeleteAPIGuildIntegration

Delete the attached integration object for the guild. Deletes any associated webhooks and kicks the associated bot if there is one.

import { deleteIntegration } from "dressed";
await deleteIntegration(guildId, integrationId);
Info

Requires the MANAGE_GUILD permission.

Get Widget Settings

GetAPIGuildWidgetSettings

Returns a guild widget settings object.

import { getWidgetSettings } from "dressed";
const widgetSettings = await getWidgetSettings(guildId);
Info

Requires the MANAGE_GUILD permission.

Modify Widget Settings

PatchAPIGuildWidgetSettings

Modify a guild widget settings object for the guild. All attributes may be passed in with JSON and modified.

import { modifyWidgetSettings } from "dressed";
await modifyWidgetSettings(guildId, data);
Info

Requires the MANAGE_GUILD permission.

Get Widget JSON

GetAPIGuildWidgetJSON

Returns the widget for the guild.

import { getWidgetJSON } from "dressed";
const widgetJSON = await getWidgetJSON(guildId);

Get Vanity Invite

GetAPIGuildVanityUrl

Returns a partial invite object for guilds with that feature enabled.

import { getVanityInvite } from "dressed";
const vanityInvite = await getVanityInvite(guildId);
Info
  • Requires the MANAGE_GUILD permission.
  • code will be null if a vanity url for the guild is not set.
  • This endpoint is required to get the usage count of the vanity invite, but the invite code can be accessed as vanity_url_code in the guild object without having the MANAGE_GUILD permission.

Get Widget Image

GetAPIGuildWidgetImage

Returns a PNG image widget for the guild.

import { getWidgetImage } from "dressed";
const widgetImage = await getWidgetImage(guildId, params?);
Info

Requires no permissions or authentication.

Get Welcome Screen

GetAPIGuildWelcomeScreen

Returns the Welcome Screen object for the guild.

import { getWelcomeScreen } from "dressed";
const welcomeScreen = await getWelcomeScreen(guildId);
Info

If the welcome screen is not enabled, the MANAGE_GUILD permission is required.

Modify Welcome Screen

PatchAPIGuildWelcomeScreen

Modify the guild's Welcome Screen.

import { modifyWelcomeScreen } from "dressed";
await modifyWelcomeScreen(guildId, data);
Info

Requires the MANAGE_GUILD permission.

Get Onboarding

GetAPIGuildOnboarding

Returns the Onboarding object for the guild.

import { getOnboarding } from "dressed";
const onboarding = await getOnboarding(guildId);

Modify Onboarding

PutAPIGuildOnboarding

Modifies the onboarding configuration of the guild.

import { modifyOnboarding } from "dressed";
await modifyOnboarding(guildId, data);
Info
  • Requires the MANAGE_GUILD and MANAGE_ROLES permissions.
  • Onboarding enforces constraints when enabled. These constraints are that there must be at least 7 Default Channels and at least 5 of them must allow sending messages to the @everyone role. The mode field modifies what is considered when enforcing these constraints.

Modify Guild Incident Actions

PutAPIGuildIncidentActions

Modifies the incident actions of the guild.

  • TODO rename to modifyIncidentActions
import { modifyGuildIncidentActions } from "dressed";
await modifyGuildIncidentActions(guildId, data);
Info
  • Requires the MANAGE_GUILD permission.
  • Both invites_disabled_until and dms_disabled_until can be enabled for a maximal timespan of 24 hours in the future.