class GuildsAPI

export declare class GuildsAPI

Constructors

constructor(
rest: REST
)

Constructs a new instance of the GuildsAPI class

addRoleToMember(
guildId: Snowflake
userId: Snowflake
roleId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Adds a role to a guild member

See also: https://discord.com/developers/docs/resources/guild#add-guild-member-role

banUser(
guildId: Snowflake
userId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Bans a user from a guild

See also: https://discord.com/developers/docs/resources/guild#create-guild-ban

bulkBanUsers(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<RESTPostAPIGuildBulkBanResult>

Bulk ban users from a guild

See also: https://discord.com/developers/docs/resources/guild#bulk-guild-ban

createAutoModerationRule(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIAutoModerationRule>

Creates a new auto moderation rule for a guild

See also: https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule

createChannel(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIChannel>

Creates a guild channel

See also: https://discord.com/developers/docs/resources/guild#create-guild-channel

createEmoji(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIEmoji>

Creates a new emoji for a guild

See also: https://discord.com/developers/docs/resources/emoji#create-guild-emoji

createRole(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIRole>

Creates a guild role

See also: https://discord.com/developers/docs/resources/guild#create-guild-role

createScheduledEvent(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIGuildScheduledEvent>

Creates a new scheduled event for a guild

See also: https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event

createSoundboardSound(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APISoundboardSound>

Creates a new soundboard sound for a guild

See also: https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound

createSticker(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APISticker>

Creates a sticker for a guild

See also: https://discord.com/developers/docs/resources/sticker#create-guild-sticker

delete(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes a guild

See also: https://discord.com/developers/docs/resources/guild#delete-guild

deleteAutoModerationRule(
guildId: Snowflake
ruleId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes an auto moderation rule for a guild

See also: https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule

deleteEmoji(
guildId: Snowflake
emojiId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes an emoji for a guild

See also: https://discord.com/developers/docs/resources/emoji#delete-guild-emoji

deleteIntegration(
guildId: Snowflake
integrationId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes an integration from a guild

See also: https://discord.com/developers/docs/resources/guild#delete-guild-integration

deleteRole(
guildId: Snowflake
roleId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes a guild role

See also: https://discord.com/developers/docs/resources/guild#delete-guild-role

deleteScheduledEvent(
guildId: Snowflake
eventId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes a scheduled event for a guild

See also: https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event

deleteSoundboardSound(
guildId: Snowflake
soundId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes a soundboard sound for a guild

See also: https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound

deleteSticker(
guildId: Snowflake
stickerId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Deletes a sticker for a guild

See also: https://discord.com/developers/docs/resources/sticker#delete-guild-sticker

deleteTemplate(
guildId: Snowflake
templateCode: string
options?: Pick<RequestData, 'signal'>
) : Promise<void>

Deletes a template for a guild

See also: https://discord.com/developers/docs/resources/guild-template#delete-guild-template

editAutoModerationRule(
guildId: Snowflake
ruleId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIAutoModerationRule>

Edits an auto moderation rule for a guild

See also: https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule

editEmoji(
guildId: Snowflake
emojiId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIEmoji>

Edits an emoji for a guild

See also: https://discord.com/developers/docs/resources/emoji#modify-guild-emoji

editMember(
guildId: Snowflake
userId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIGuildMember>

Edits a guild member

See also: https://discord.com/developers/docs/resources/guild#modify-guild-member

editMFALevel(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<RESTPostAPIGuildsMFAJSONBody>

Edits the multi-factor-authentication (MFA) level of a guild

See also: https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level

editRole(
guildId: Snowflake
roleId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIRole>

Edits a guild role

See also: https://discord.com/developers/docs/resources/guild#modify-guild-role

editSoundboardSound(
guildId: Snowflake
soundId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APISoundboardSound>

Edits a soundboard sound for a guild

See also: https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound

editSticker(
guildId: Snowflake
stickerId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APISticker>

Edits a sticker for a guild

See also: https://discord.com/developers/docs/resources/sticker#modify-guild-sticker

editTemplate(
guildId: Snowflake
templateCode: string
options?: Pick<RequestData, 'signal'>
) : Promise<APITemplate>

Edits a template for a guild

See also: https://discord.com/developers/docs/resources/guild-template#modify-guild-template

editWelcomeScreen(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIGuildWelcomeScreen>

Edits the welcome screen for a guild

See also: https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen

editWidgetSettings(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<APIGuildWidgetSettings>

Edits the widget settings for a guild

See also: https://discord.com/developers/docs/resources/guild#modify-guild-widget

getActiveThreads(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIThreadList>

Fetches the active threads in a guild

See also: https://discord.com/developers/docs/resources/guild#list-active-guild-threads

getAuditLogs(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIAuditLog>

Fetches the audit logs for a guild

See also: https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log

getAutoModerationRule(
guildId: Snowflake
ruleId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIAutoModerationRule>

Fetches an auto moderation rule for a guild

See also: https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule

getAutoModerationRules(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIAutoModerationRulesResult>

Fetches all auto moderation rules for a guild

See also: https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild

getEmoji(
guildId: Snowflake
emojiId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIEmoji>

Fetches an emoji for a guild

See also: https://discord.com/developers/docs/resources/emoji#get-guild-emoji

getEmojis(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildEmojisResult>

Fetches all emojis for a guild

See also: https://discord.com/developers/docs/resources/emoji#list-guild-emojis

getIntegrations(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildIntegrationsResult>

Fetches the integrations for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-integrations

getInvites(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildInvitesResult>

Fetches the invites for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-invites

getMember(
guildId: Snowflake
userId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildMember>

Fetches a guild member

See also: https://discord.com/developers/docs/resources/guild#get-guild-member

getMemberBan(
guildId: Snowflake
userId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIBan>

Fetches a guild member ban

See also: https://discord.com/developers/docs/resources/guild#get-guild-ban

getOnboarding(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildOnboarding>

Fetches a guild onboarding

See also: https://discord.com/developers/docs/resources/guild#get-guild-onboarding

getPreview(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildPreview>

Fetches a guild preview

See also: https://discord.com/developers/docs/resources/guild#get-guild-preview

Fetch the number of members that can be pruned from a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-prune-count

getRole(
guildId: Snowflake
roleId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIRole>

Get a role in a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-role

getRoles(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildRolesResult>

Gets all the roles in a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-roles

getSoundboardSound(
guildId: Snowflake
soundId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APISoundboardSound>

Fetches a soundboard sound for a guild

See also: https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound

getSoundboardSounds(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildSoundboardSoundsResult>

Fetches all the soundboard sounds for a guild

See also: https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds

getSticker(
guildId: Snowflake
stickerId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APISticker>

Fetches a sticker for a guild

See also: https://discord.com/developers/docs/resources/sticker#get-guild-sticker

getStickers(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildStickersResult>

Fetches all the stickers for a guild

See also: https://discord.com/developers/docs/resources/sticker#list-guild-stickers

getTemplate(
templateCode: string
options?: Pick<RequestData, 'signal'>
) : Promise<APITemplate>

Fetches a guild template

See also: https://discord.com/developers/docs/resources/guild-template#get-guild-template

getTemplates(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildTemplatesResult>

Fetches all the templates for a guild

See also: https://discord.com/developers/docs/resources/guild-template#get-guild-templates

getVanityURL(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildVanityUrlResult>

Fetches the vanity url for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-vanity-url

getVoiceRegions(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildVoiceRegionsResult>

Fetches voice regions for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-voice-regions

getWelcomeScreen(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildWelcomeScreen>

Fetches the welcome screen for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen

getWidget(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildWidget>

Fetches the widget for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-widget

getWidgetImage(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<ArrayBuffer>

Fetches the widget image for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-widget-image

getWidgetSettings(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<APIGuildWidgetSettings>

Fetches the widget settings for a guild

See also: https://discord.com/developers/docs/resources/guild#get-guild-widget-settings

removeMember(
guildId: Snowflake
userId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<unknown>

Removes a member from a guild

See also: https://discord.com/developers/docs/resources/guild#remove-guild-member

removeRoleFromMember(
guildId: Snowflake
userId: Snowflake
roleId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Removes a role from a guild member

See also: https://discord.com/developers/docs/resources/guild#remove-guild-member-role

setChannelPositions(
guildId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Edits a guild channel's positions

See also: https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions

syncTemplate(
guildId: Snowflake
templateCode: string
options?: Pick<RequestData, 'signal'>
) : Promise<APITemplate>

Syncs a template for a guild

See also: https://discord.com/developers/docs/resources/guild-template#sync-guild-template

unbanUser(
guildId: Snowflake
userId: Snowflake
options?: Pick<RequestData, 'reason' | 'signal'>
) : Promise<void>

Unbans a user from a guild

See also: https://discord.com/developers/docs/resources/guild#remove-guild-ban