class GuildsAPI

declare class GuildsAPI

Constructors

constructor(
rest: REST
)

Constructs a new instance of the GuildsAPI class

addRoleToMember(
guildId: Snowflake
userId: Snowflake
roleId: Snowflake
reason?: string
) : Promise<void>

Adds a role to a guild member

banUser(
guildId: Snowflake
userId: Snowflake
reason?: string
) : Promise<void>

Bans a user from a guild

Prunes members in a guild

Creates a new auto moderation rule for a guild

Creates a guild channel

Creates a new emoji for a guild

Creates a guild role

Creates a new scheduled event for a guild

createSticker(
guildId: Snowflake
reason?: string
) : Promise<discord_api_types_v10.APISticker>

Creates a sticker for a guild

Creates a new template

delete(
guildId: Snowflake
reason?: string
) : Promise<void>

Deletes a guild

deleteAutoModerationRule(
guildId: Snowflake
ruleId: Snowflake
reason?: string
) : Promise<void>

Deletes an auto moderation rule for a guild

deleteEmoji(
guildId: Snowflake
emojiId: Snowflake
reason?: string
) : Promise<void>

Deletes an emoji for a guild

deleteIntegration(
guildId: Snowflake
integrationId: Snowflake
reason?: string
) : Promise<void>

Deletes an integration from a guild

deleteRole(
guildId: Snowflake
roleId: Snowflake
reason?: string
) : Promise<void>

Deletes a guild role

deleteScheduledEvent(
guildId: Snowflake
eventId: Snowflake
reason?: string
) : Promise<void>

Deletes a scheduled event for a guild

deleteSticker(
guildId: Snowflake
stickerId: Snowflake
reason?: string
) : Promise<void>

Deletes a sticker for a guild

deleteTemplate(
guildId: Snowflake
templateCode: string
) : Promise<void>

Deletes a template for a guild

Edits an auto moderation rule for a guild

Edits an emoji for a guild

Edits a guild member

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

Edits a guild role

Edits a scheduled event for a guild

Edits a sticker for a guild

Edits a template for a guild

editUserVoiceState() : Promise<void>

Edits a user's voice state in a guild

Edits the welcome screen for a guild

Edits the widget settings for a guild

Fetches a guild

Fetches the active threads in a guild

Fetches the audit logs for a guild

getAutoModerationRule(
guildId: Snowflake
ruleId: Snowflake
) : Promise<discord_api_types_v10.APIAutoModerationRule>

Fetches an auto moderation rule for a guild

getAutoModerationRules(
guildId: Snowflake
) : Promise<RESTGetAPIAutoModerationRulesResult>

Fetches all auto moderation rules for a guild

Fetches a guild's channels

Fetches an emoji for a guild

Fetches all emojis for a guild

Fetches the integrations for a guild

Fetches the invites for a guild

Fetches a guild member

getMemberBans(
guildId: Snowflake
) : Promise<RESTGetAPIGuildBansResult>

Fetches a guild member ban

Fetches all the members of a guild

Fetches a guild preview

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

Gets all the roles in a guild

Fetches a scheduled event for a guild

Fetches all scheduled events for a guild

Gets all users that are interested in a scheduled event

getSticker(
guildId: Snowflake
stickerId: Snowflake
) : Promise<discord_api_types_v10.APISticker>

Fetches a sticker for a guild

Fetches all the stickers for a guild

getTemplate(
templateCode: string
) : Promise<discord_api_types_v10.APITemplate>

Fetches a guild template

Fetches all the templates for a guild

Fetches the vanity url for a guild

Fetches voice regions for a guild

Fetches the welcome screen for a guild

Fetches the widget for a guild

getWidgetImage(
guildId: Snowflake
) : Promise<ArrayBuffer>

Fetches the widget image for a guild

getWidgetSettings(
guildId: Snowflake
) : Promise<ArrayBuffer>

Fetches the widget settings for a guild

removeRoleFromMember(
guildId: Snowflake
userId: Snowflake
roleId: Snowflake
reason?: string
) : Promise<void>

Removes a role from a guild member

Searches for guild members

setChannelPositions() : Promise<void>

Edits a guild channel's positions

Sets role positions in a guild

syncTemplate(
guildId: Snowflake
templateCode: string
) : Promise<discord_api_types_v10.APITemplate>

Syncs a template for a guild

unbanUser(
guildId: Snowflake
userId: Snowflake
reason?: string
) : Promise<void>

Unbans a user from a guild