Search...

GuildsAPI

declare class GuildsAPI 
declare class GuildsAPI 

No summary provided.

constructor(rest)

Constructs a new instance of the GuildsAPI class
NameTypeOptionalDescription
restRESTNoNone

addRoleToMember(guildId, userId, roleId, reason?)

:

Promise<void>

Adds a role to a guild member
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
roleIdSnowflakeNoThe id of the role
reasonstringYesThe reason for adding this role to the guild member

banUser(guildId, userId, options?, reason?)

:

Promise<void>

Bans a user from a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to ban the member in
userIdSnowflakeNoThe id of the user to ban
optionsRESTPutAPIGuildBanJSONBodyYesOptions for banning the user
reasonstringYesThe reason for banning the user

beginPrune(guildId, options?, reason?)

:

Promise<RESTGetAPIGuildPruneCountResult>

Prunes members in a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to prune members in
optionsRESTPostAPIGuildPruneJSONBodyYesThe options for pruning members
reasonstringYesThe reason for pruning members

create(data)

:

Promise<discord_api_types_v10.APIGuild>

Creates a guild
NameTypeOptionalDescription
dataRESTPostAPIGuildsJSONBodyNoThe guild to create

createAutoModerationRule(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIAutoModerationRule>

Creates a new auto moderation rule for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the auto moderation rule from
dataRESTPostAPIAutoModerationRuleJSONBodyNoThe data for creating the auto moderation rule
reasonstringYesNone

createChannel(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIChannel>

Creates a guild channel
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the channel in
dataRESTPostAPIGuildChannelJSONBodyNoThe data to create the new channel
reasonstringYesThe reason for creating this channel

createEmoji(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIEmoji>

Creates a new emoji for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the emoji from
dataRESTPostAPIGuildEmojiJSONBodyNoThe data for creating the emoji
reasonstringYesThe reason for creating the emoji

createRole(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIRole>

Creates a guild role
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the role in
dataRESTPostAPIGuildRoleJSONBodyNoThe data to create the role with
reasonstringYesThe reason for creating the role

createScheduledEvent(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIGuildScheduledEvent>

Creates a new scheduled event for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the scheduled event from
dataRESTPostAPIGuildScheduledEventJSONBodyNoThe data to create the event with
reasonstringYesThe reason for creating the scheduled event

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

:

Promise<discord_api_types_v10.APISticker>

Creates a sticker for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to create the sticker for
{ file, ...body }Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> & { file: RawFile; }NoNone
reasonstringYesThe reason for creating the sticker

createTemplate(templateCode, data)

:

Promise<discord_api_types_v10.APITemplate>

Creates a new template
NameTypeOptionalDescription
templateCodestringNoThe code of the template
dataRESTPostAPITemplateCreateGuildJSONBodyNoThe data to use when creating the template

delete(guildId, reason?)

:

Promise<void>

Deletes a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete
reasonstringYesThe reason for deleting this guild

deleteAutoModerationRule(guildId, ruleId, reason?)

:

Promise<void>

Deletes an auto moderation rule for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the auto moderation rule from
ruleIdSnowflakeNoThe id of the auto moderation rule to delete
reasonstringYesThe reason for deleting the auto moderation rule

deleteEmoji(guildId, emojiId, reason?)

:

Promise<void>

Deletes an emoji for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the emoji from
emojiIdSnowflakeNoThe id of the emoji to delete
reasonstringYesThe reason for deleting the emoji

deleteIntegration(guildId, integrationId, reason?)

:

Promise<void>

Deletes an integration from a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the integration from
integrationIdSnowflakeNoThe id of the integration to delete
reasonstringYesThe reason for deleting the integration

deleteRole(guildId, roleId, reason?)

:

Promise<void>

Deletes a guild role
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the role in
roleIdSnowflakeNoThe id of the role to delete
reasonstringYesThe reason for deleting the role

deleteScheduledEvent(guildId, eventId, reason?)

:

Promise<void>

Deletes a scheduled event for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the scheduled event from
eventIdSnowflakeNoThe id of the scheduled event to delete
reasonstringYesThe reason for deleting the scheduled event

deleteSticker(guildId, stickerId, reason?)

:

Promise<void>

Deletes a sticker for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the sticker from
stickerIdSnowflakeNoThe id of the sticker to delete
reasonstringYesThe reason for deleting the sticker

deleteTemplate(guildId, templateCode)

:

Promise<void>

Deletes a template for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to delete the template from
templateCodestringNoThe code of the template to delete

edit(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIGuild>

Edits a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit
dataRESTPatchAPIGuildJSONBodyNoThe new guild data
reasonstringYesThe reason for editing this guild

editAutoModerationRule(guildId, ruleId, data, reason?)

:

Promise<RESTPatchAPIAutoModerationRuleJSONBody>

Edits an auto moderation rule for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the auto moderation rule from
ruleIdSnowflakeNoThe id of the auto moderation rule to edit
dataRESTPatchAPIAutoModerationRuleJSONBodyNoThe data for editing the auto moderation rule
reasonstringYesThe reason for editing the auto moderation rule

editEmoji(guildId, emojiId, data, reason?)

:

Promise<discord_api_types_v10.APIEmoji>

Edits an emoji for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the emoji from
emojiIdSnowflakeNoThe id of the emoji to edit
dataRESTPatchAPIGuildEmojiJSONBodyNoThe data for editing the emoji
reasonstringYesThe reason for editing the emoji

editMember(guildId, userId, data?, reason?)

:

Promise<discord_api_types_v10.APIGuildMember>

Edits a guild member
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
dataRESTPatchAPIGuildMemberJSONBodyYesThe data to use when editing the guild member
reasonstringYesThe reason for editing this guild member

editMFALevel(guildId, level, reason?)

:

Promise<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
reasonstringYesThe reason for editing the MFA level

editRole(guildId, roleId, data, reason?)

:

Promise<discord_api_types_v10.APIRole>

Edits a guild role
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the role in
roleIdSnowflakeNoThe id of the role to edit
dataRESTPatchAPIGuildRoleJSONBodyNodata for editing the role
reasonstringYesThe reason for editing the role

editScheduledEvent(guildId, eventId, data, reason?)

:

Promise<discord_api_types_v10.APIGuildScheduledEvent>

Edits a scheduled event for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the scheduled event from
eventIdSnowflakeNoThe id of the scheduled event to edit
dataRESTPatchAPIGuildScheduledEventJSONBodyNoThe new event data
reasonstringYesThe reason for editing the scheduled event

editSticker(guildId, stickerId, data, reason?)

:

Promise<discord_api_types_v10.APISticker>

Edits a sticker for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the sticker from
stickerIdSnowflakeNoThe id of the sticker to edit
dataRESTPatchAPIGuildStickerJSONBodyNoThe data for editing the sticker
reasonstringYesThe reason for editing the sticker

editTemplate(guildId, templateCode, data)

:

Promise<discord_api_types_v10.APITemplate>

Edits a template for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the template from
templateCodestringNoThe code of the template to edit
dataRESTPatchAPIGuildTemplateJSONBodyNoThe data for editing the template

editUserVoiceState(guildId, userId, data, reason?)

:

Promise<void>

Edits a user's voice state in a guild
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
dataRESTPatchAPIGuildVoiceStateUserJSONBodyNoThe data for editing the voice state
reasonstringYesThe reason for editing the voice state

editWelcomeScreen(guildId, data?, reason?)

:

Promise<discord_api_types_v10.APIGuildWelcomeScreen>

Edits the welcome screen for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the welcome screen for
dataRESTPatchAPIGuildWelcomeScreenJSONBodyYesThe new welcome screen data
reasonstringYesThe reason for editing the welcome screen

editWidgetSettings(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIGuildWidgetSettings>

Edits the widget settings for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the widget settings from
dataRESTPatchAPIGuildWidgetSettingsJSONBodyNoThe new widget settings data
reasonstringYesThe reason for editing the widget settings

get(guildId)

:

Promise<discord_api_types_v10.APIGuild>

Fetches a guild
NameTypeOptionalDescription
guildIdstringNoThe id of the guild

getActiveThreads(guildId)

:

Promise<discord_api_types_v10.APIThreadList>

Fetches the active threads in a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the active threads from

getAuditLogs(guildId, options?)

:

Promise<discord_api_types_v10.APIAuditLog>

Fetches the audit logs for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the audit logs from
optionsRESTGetAPIAuditLogQueryYesThe options for fetching the audit logs

getAutoModerationRule(guildId, ruleId)

:

Promise<discord_api_types_v10.APIAutoModerationRule>

Fetches an auto moderation rule for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the auto moderation rule from
ruleIdSnowflakeNoThe id of the auto moderation rule to fetch

getAutoModerationRules(guildId)

:

Promise<RESTGetAPIAutoModerationRulesResult>

Fetches all auto moderation rules for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the auto moderation rules from

getChannels(guildId)

:

Promise<RESTGetAPIGuildChannelsResult>

Fetches a guild's channels
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the channels from

getEmoji(guildId, emojiId)

:

Promise<discord_api_types_v10.APIEmoji>

Fetches an emoji for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the emoji from
emojiIdSnowflakeNoThe id of the emoji to fetch

getEmojis(guildId)

:

Promise<RESTGetAPIGuildEmojisResult>

Fetches all emojis for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the emojis from

getIntegrations(guildId)

:

Promise<RESTGetAPIGuildIntegrationsResult>

Fetches the integrations for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the integrations from

getInvites(guildId)

:

Promise<RESTGetAPIGuildInvitesResult>

Fetches the invites for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the invites from

getMember(guildId, userId)

:

Promise<discord_api_types_v10.APIGuildMember>

Fetches a guild member
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user

getMemberBans(guildId)

:

Promise<RESTGetAPIGuildBansResult>

Fetches a guild member ban
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the ban from

getMembers(guildId, options?)

:

Promise<discord_api_types_v10.APIGuildMember>

Fetches all the members of a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
optionsRESTGetAPIGuildMembersQueryYesThe options to use when fetching the guild members

getPreview(guildId)

:

Promise<discord_api_types_v10.APIGuildPreview>

Fetches a guild preview
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the preview from

getPruneCount(guildId, options?)

:

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
optionsRESTGetAPIGuildPruneCountQueryYesThe options for fetching the number of pruned members

getRoles(guildId)

:

Promise<RESTGetAPIGuildRolesResult>

Gets all the roles in a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the roles from

getScheduledEvent(guildId, eventId, options?)

:

Promise<discord_api_types_v10.APIGuildScheduledEvent>

Fetches a scheduled event for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the scheduled event from
eventIdSnowflakeNoThe id of the scheduled event to fetch
optionsRESTGetAPIGuildScheduledEventQueryYesThe options for fetching the scheduled event

getScheduledEvents(guildId, options?)

:

Promise<RESTGetAPIGuildScheduledEventsResult>

Fetches all scheduled events for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the scheduled events from
optionsRESTGetAPIGuildScheduledEventsQueryYesThe options for fetching the scheduled events

getScheduledEventUsers(guildId, eventId, options?)

:

Promise<RESTGetAPIGuildScheduledEventUsersResult>

Gets all users that are interested in a scheduled event
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the scheduled event users from
eventIdSnowflakeNoThe id of the scheduled event to fetch the users for
optionsRESTGetAPIGuildScheduledEventUsersQueryYesThe options for fetching the scheduled event users

getSticker(guildId, stickerId)

:

Promise<discord_api_types_v10.APISticker>

Fetches a sticker for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the sticker from
stickerIdSnowflakeNoThe id of the sticker to fetch

getStickers(guildId)

:

Promise<RESTGetAPIGuildStickersResult>

Fetches all the stickers for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the stickers from

getTemplate(templateCode)

:

Promise<discord_api_types_v10.APITemplate>

Fetches a guild template
NameTypeOptionalDescription
templateCodestringNoThe code of the template

getTemplates(guildId)

:

Promise<RESTGetAPIGuildTemplatesResult>

Fetches all the templates for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the templates from

getVanityURL(guildId)

:

Promise<RESTGetAPIGuildVanityUrlResult>

Fetches the vanity url for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the vanity url from

getVoiceRegions(guildId)

:

Promise<RESTGetAPIGuildVoiceRegionsResult>

Fetches voice regions for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the voice regions from

getWelcomeScreen(guildId)

:

Promise<discord_api_types_v10.APIGuildWelcomeScreen>

Fetches the welcome screen for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the welcome screen from

getWidget(guildId)

:

Promise<discord_api_types_v10.APIGuildWidget>

Fetches the widget for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget from

getWidgetImage(guildId, style?)

:

Promise<ArrayBuffer>

Fetches the widget image for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget image from
styleGuildWidgetStyleYesThe style of the widget image

getWidgetSettings(guildId)

:

Promise<ArrayBuffer>

Fetches the widget settings for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget settings from

removeRoleFromMember(guildId, userId, roleId, reason?)

:

Promise<void>

Removes a role from a guild member
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user
roleIdSnowflakeNoThe id of the role
reasonstringYesThe reason for removing this role from the guild member

searchForMembers(guildId, options)

:

Promise<RESTGetAPIGuildMembersSearchResult>

Searches for guild members
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to search in
optionsRESTGetAPIGuildMembersSearchQueryNoNone

setChannelPositions(guildId, data, reason?)

:

Promise<void>

Edits a guild channel's positions
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to edit the channel positions from
dataRESTPatchAPIGuildChannelPositionsJSONBodyNoThe data to edit the channel positions with
reasonstringYesThe reason for editing the channel positions

setRolePositions(guildId, data, reason?)

:

Promise<RESTPatchAPIGuildRolePositionsResult>

Sets role positions in a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to set role positions for
dataRESTPatchAPIGuildRolePositionsJSONBodyNoThe data for setting a role position
reasonstringYesThe reason for setting the role position

syncTemplate(guildId, templateCode)

:

Promise<discord_api_types_v10.APITemplate>

Syncs a template for a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to sync the template from
templateCodestringNoThe code of the template to sync

unbanUser(guildId, userId, reason?)

:

Promise<void>

Unbans a user from a guild
NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to unban the member in
userIdSnowflakeNoThe id of the user to unban
reasonstringYesThe reason for unbanning the user