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

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

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

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

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

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

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

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

Deletes a guild

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fetches a guild onboarding

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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