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

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

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
options: Snowflake
{ reason, signal }?: 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

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<RESTPatchAPIAutoModerationRuleJSONBody>

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

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

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

Edits a user's voice state in a guild

See also: https://discord.com/developers/docs/resources/guild#modify-user-voice-state

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

get(
guildId: string
options: Pick<RequestData, 'signal'>
) : Promise<APIGuild>

Fetches a guild

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

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

getMemberBans(
guildId: Snowflake
options?: Pick<RequestData, 'signal'>
) : Promise<RESTGetAPIGuildBansResult>

Fetches a guild member ban

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

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

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

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<ArrayBuffer>

Fetches the widget settings for a guild

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

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