Search...

GuildsAPI

export declare class GuildsAPI 
export declare class GuildsAPI 

No summary provided.

constructor(rest)

Constructs a new instance of the GuildsAPI class
NameTypeOptionalDescription
restRESTNoNone

addRoleToMember(guildId, userId, roleId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
roleIdSnowflakeNoThe id of the role
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

banUser(guildId, userId, body?, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to ban the member in
userIdSnowflakeNoThe id of the user to ban
bodyRESTPutAPIGuildBanJSONBodyYesThe payload for banning the user
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

beginPrune(guildId, body?, { reason, signal }?)

:

Promise<RESTGetAPIGuildPruneCountResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to prune members in
bodyRESTPostAPIGuildPruneJSONBodyYesThe options for pruning members
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

create(body, { signal })

:

Promise<import("discord-api-types/v10").APIGuild>

NameTypeOptionalDescription
bodyRESTPostAPIGuildsJSONBodyNoThe guild to create
{ signal }Pick<RequestData, 'signal'>NoNone

createAutoModerationRule(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIAutoModerationRule>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the auto moderation rule from
bodyRESTPostAPIAutoModerationRuleJSONBodyNoThe data for creating the auto moderation rule
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

createChannel(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIChannel>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the channel in
bodyRESTPostAPIGuildChannelJSONBodyNoThe data to create the new channel
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

createEmoji(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIEmoji>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the emoji from
bodyRESTPostAPIGuildEmojiJSONBodyNoThe data for creating the emoji
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

createRole(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIRole>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the role in
bodyRESTPostAPIGuildRoleJSONBodyNoThe data to create the role with
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

createScheduledEvent(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuildScheduledEvent>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the scheduled event from
bodyRESTPostAPIGuildScheduledEventJSONBodyNoThe data to create the event with
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

createSticker(guildId, { file, ...body }, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APISticker>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the sticker for
{ file, ...body }Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> & { file: RawFile; }NoNone
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

createTemplate(templateCode, body, { signal }?)

:

Promise<import("discord-api-types/v10").APITemplate>

NameTypeOptionalDescription
templateCodestringNoThe code of the template
bodyRESTPostAPITemplateCreateGuildJSONBodyNoThe data to use when creating the template
{ signal }Pick<RequestData, 'signal'>YesNone

delete(guildId, { signal, reason }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete
{ signal, reason }Pick<RequestData, 'reason' | 'signal'>YesNone

deleteAutoModerationRule(guildId, ruleId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the auto moderation rule from
ruleIdSnowflakeNoNone
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

deleteEmoji(guildId, emojiId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the emoji from
emojiIdSnowflakeNoThe id of the emoji to delete
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

deleteIntegration(guildId, integrationId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the integration from
integrationIdSnowflakeNoThe id of the integration to delete
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

deleteRole(guildId, roleId, { reason, signal })

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the role in
roleIdSnowflakeNoThe id of the role to delete
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>NoNone

deleteScheduledEvent(guildId, eventId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the scheduled event from
eventIdSnowflakeNoThe id of the scheduled event to delete
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

deleteSticker(guildId, stickerId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the sticker from
stickerIdSnowflakeNoThe id of the sticker to delete
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

deleteTemplate(guildId, templateCode, { signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the template from
templateCodestringNoThe code of the template to delete
{ signal }Pick<RequestData, 'signal'>YesNone

edit(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuild>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit
bodyRESTPatchAPIGuildJSONBodyNoThe new guild data
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editAutoModerationRule(guildId, ruleId, body, { reason, signal }?)

:

Promise<RESTPatchAPIAutoModerationRuleJSONBody>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the auto moderation rule from
ruleIdSnowflakeNoThe id of the auto moderation rule to edit
bodyRESTPatchAPIAutoModerationRuleJSONBodyNoThe data for editing the auto moderation rule
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editEmoji(guildId, emojiId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIEmoji>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the emoji from
emojiIdSnowflakeNoThe id of the emoji to edit
bodyRESTPatchAPIGuildEmojiJSONBodyNoThe data for editing the emoji
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editMember(guildId, userId, body?, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuildMember>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
bodyRESTPatchAPIGuildMemberJSONBodyYesThe data to use when editing the guild member
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editMFALevel(guildId, level, { reason, signal }?)

:

Promise<import("discord-api-types/v10").RESTPostAPIGuildsMFAJSONBody>

Edits the multi-factor-authentication (MFA) level of a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the MFA level for
levelGuildMFALevelNoThe new MFA level
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editRole(guildId, roleId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIRole>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the role in
roleIdSnowflakeNoThe id of the role to edit
bodyRESTPatchAPIGuildRoleJSONBodyNodata for editing the role
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editScheduledEvent(guildId, eventId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuildScheduledEvent>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the scheduled event from
eventIdSnowflakeNoThe id of the scheduled event to edit
bodyRESTPatchAPIGuildScheduledEventJSONBodyNoThe new event data
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editSticker(guildId, stickerId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APISticker>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the sticker from
stickerIdSnowflakeNoThe id of the sticker to edit
bodyRESTPatchAPIGuildStickerJSONBodyNoThe data for editing the sticker
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editTemplate(guildId, templateCode, body, { signal }?)

:

Promise<import("discord-api-types/v10").APITemplate>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the template from
templateCodestringNoThe code of the template to edit
bodyRESTPatchAPIGuildTemplateJSONBodyNoThe data for editing the template
{ signal }Pick<RequestData, 'signal'>YesNone

editUserVoiceState(guildId, userId, body, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the current user's voice state in
userIdSnowflakeNoThe id of the user to edit the voice state for
bodyRESTPatchAPIGuildVoiceStateUserJSONBodyNoThe data for editing the voice state
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editWelcomeScreen(guildId, body?, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuildWelcomeScreen>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the welcome screen for
bodyRESTPatchAPIGuildWelcomeScreenJSONBodyYesThe new welcome screen data
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

editWidgetSettings(guildId, body, { reason, signal }?)

:

Promise<import("discord-api-types/v10").APIGuildWidgetSettings>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the widget settings from
bodyRESTPatchAPIGuildWidgetSettingsJSONBodyNoThe new widget settings data
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

get(guildId, { signal })

:

Promise<import("discord-api-types/v10").APIGuild>

NameTypeOptionalDescription
guildIdstringNoThe id of the guild
{ signal }Pick<RequestData, 'signal'>NoNone

getActiveThreads(guildId, { signal }?)

:

Promise<import("discord-api-types/v10").APIThreadList>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the active threads from
{ signal }Pick<RequestData, 'signal'>YesNone

getAuditLogs(guildId, query?, { signal }?)

:

Promise<import("discord-api-types/v10").APIAuditLog>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the audit logs from
queryRESTGetAPIAuditLogQueryYesThe query options for fetching the audit logs
{ signal }Pick<RequestData, 'signal'>YesNone

getAutoModerationRule(guildId, ruleId, { signal }?)

:

Promise<import("discord-api-types/v10").APIAutoModerationRule>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the auto moderation rule from
ruleIdSnowflakeNoThe id of the auto moderation rule to fetch
{ signal }Pick<RequestData, 'signal'>YesNone

getAutoModerationRules(guildId, { signal }?)

:

Promise<RESTGetAPIAutoModerationRulesResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the auto moderation rules from
{ signal }Pick<RequestData, 'signal'>YesNone

getChannels(guildId, { signal }?)

:

Promise<RESTGetAPIGuildChannelsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the channels from
{ signal }Pick<RequestData, 'signal'>YesNone

getEmoji(guildId, emojiId, { signal }?)

:

Promise<import("discord-api-types/v10").APIEmoji>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the emoji from
emojiIdSnowflakeNoThe id of the emoji to fetch
{ signal }Pick<RequestData, 'signal'>YesNone

getEmojis(guildId, { signal }?)

:

Promise<RESTGetAPIGuildEmojisResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the emojis from
{ signal }Pick<RequestData, 'signal'>YesNone

getIntegrations(guildId, { signal }?)

:

Promise<RESTGetAPIGuildIntegrationsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the integrations from
{ signal }Pick<RequestData, 'signal'>YesNone

getInvites(guildId, { signal }?)

:

Promise<RESTGetAPIGuildInvitesResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the invites from
{ signal }Pick<RequestData, 'signal'>YesNone

getMember(guildId, userId, { signal }?)

:

Promise<import("discord-api-types/v10").APIGuildMember>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
{ signal }Pick<RequestData, 'signal'>YesNone

getMemberBans(guildId, { signal }?)

:

Promise<RESTGetAPIGuildBansResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the ban from
{ signal }Pick<RequestData, 'signal'>YesNone

getMembers(guildId, query?, { signal }?)

:

Promise<RESTGetAPIGuildMembersResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
queryRESTGetAPIGuildMembersQueryYesThe query to use when fetching the guild members
{ signal }Pick<RequestData, 'signal'>YesNone

getPreview(guildId, { signal })

:

Promise<import("discord-api-types/v10").APIGuildPreview>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the preview from
{ signal }Pick<RequestData, 'signal'>NoNone

getPruneCount(guildId, query?, { signal }?)

:

Promise<RESTGetAPIGuildPruneCountResult>

Fetch the number of members that can be pruned from a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the number of pruned members from
queryRESTGetAPIGuildPruneCountQueryYesThe query options for fetching the number of pruned members
{ signal }Pick<RequestData, 'signal'>YesNone

getRoles(guildId, { signal }?)

:

Promise<RESTGetAPIGuildRolesResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the roles from
{ signal }Pick<RequestData, 'signal'>YesNone

getScheduledEvent(guildId, eventId, query?, { signal }?)

:

Promise<import("discord-api-types/v10").APIGuildScheduledEvent>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the scheduled event from
eventIdSnowflakeNoThe id of the scheduled event to fetch
queryRESTGetAPIGuildScheduledEventQueryYesThe options for fetching the scheduled event
{ signal }Pick<RequestData, 'signal'>YesNone

getScheduledEvents(guildId, query?, { signal }?)

:

Promise<RESTGetAPIGuildScheduledEventsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the scheduled events from
queryRESTGetAPIGuildScheduledEventsQueryYesThe query options for fetching the scheduled events
{ signal }Pick<RequestData, 'signal'>YesNone

getScheduledEventUsers(guildId, eventId, query?, { signal }?)

:

Promise<RESTGetAPIGuildScheduledEventUsersResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the scheduled event users from
eventIdSnowflakeNoThe id of the scheduled event to fetch the users for
queryRESTGetAPIGuildScheduledEventUsersQueryYesThe options for fetching the scheduled event users
{ signal }Pick<RequestData, 'signal'>YesNone

getSticker(guildId, stickerId, { signal }?)

:

Promise<import("discord-api-types/v10").APISticker>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the sticker from
stickerIdSnowflakeNoThe id of the sticker to fetch
{ signal }Pick<RequestData, 'signal'>YesNone

getStickers(guildId, { signal }?)

:

Promise<RESTGetAPIGuildStickersResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the stickers from
{ signal }Pick<RequestData, 'signal'>YesNone

getTemplate(templateCode, { signal }?)

:

Promise<import("discord-api-types/v10").APITemplate>

NameTypeOptionalDescription
templateCodestringNoThe code of the template
{ signal }Pick<RequestData, 'signal'>YesNone

getTemplates(guildId, { signal }?)

:

Promise<RESTGetAPIGuildTemplatesResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the templates from
{ signal }Pick<RequestData, 'signal'>YesNone

getVanityURL(guildId, { signal }?)

:

Promise<RESTGetAPIGuildVanityUrlResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the vanity url from
{ signal }Pick<RequestData, 'signal'>YesNone

getVoiceRegions(guildId, { signal }?)

:

Promise<RESTGetAPIGuildVoiceRegionsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the voice regions from
{ signal }Pick<RequestData, 'signal'>YesNone

getWebhooks(id)

:

Promise<RESTGetAPIGuildWebhooksResult>

NameTypeOptionalDescription
idSnowflakeNoThe id of the guild

getWelcomeScreen(guildId, { signal }?)

:

Promise<import("discord-api-types/v10").APIGuildWelcomeScreen>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the welcome screen from
{ signal }Pick<RequestData, 'signal'>YesNone

getWidget(guildId, { signal }?)

:

Promise<import("discord-api-types/v10").APIGuildWidget>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget from
{ signal }Pick<RequestData, 'signal'>YesNone

getWidgetImage(guildId, style?, { signal }?)

:

Promise<ArrayBuffer>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget image from
styleGuildWidgetStyleYesThe style of the widget image
{ signal }Pick<RequestData, 'signal'>YesNone

getWidgetSettings(guildId, { signal }?)

:

Promise<ArrayBuffer>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget settings from
{ signal }Pick<RequestData, 'signal'>YesNone

removeRoleFromMember(guildId, userId, roleId, { reason, signal })

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
roleIdSnowflakeNoThe id of the role
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>NoNone

searchForMembers(guildId, query, { signal }?)

:

Promise<RESTGetAPIGuildMembersSearchResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to search in
queryRESTGetAPIGuildMembersSearchQueryNoThe query to search for
{ signal }Pick<RequestData, 'signal'>YesNone

setChannelPositions(guildId, body, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the channel positions from
bodyRESTPatchAPIGuildChannelPositionsJSONBodyNoThe data to edit the channel positions with
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

setRolePositions(guildId, body, { reason, signal }?)

:

Promise<RESTPatchAPIGuildRolePositionsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to set role positions for
bodyRESTPatchAPIGuildRolePositionsJSONBodyNoThe data for setting a role position
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone

setVoiceState(guildId, body?)

:

Promise<never>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
bodyRESTPatchAPIGuildVoiceStateCurrentMemberJSONBodyYesThe options to use when setting the voice state

syncTemplate(guildId, templateCode, { signal }?)

:

Promise<import("discord-api-types/v10").APITemplate>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to sync the template from
templateCodestringNoThe code of the template to sync
{ signal }Pick<RequestData, 'signal'>YesNone

unbanUser(guildId, userId, { reason, signal }?)

:

Promise<void>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to unban the member in
userIdSnowflakeNoThe id of the user to unban
{ reason, signal }Pick<RequestData, 'reason' | 'signal'>YesNone