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>

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>

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>

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>

NameTypeOptionalDescription
dataRESTPostAPIGuildsJSONBodyNoThe guild to create

createAutoModerationRule(guildId, data, reason?)

:

Promise<discord_api_types_v10.APIAutoModerationRule>

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>

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>

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>

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>

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>

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>

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

delete(guildId, reason?)

:

Promise<void>

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

deleteAutoModerationRule(guildId, ruleId, reason?)

:

Promise<void>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

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>

NameTypeOptionalDescription
guildIdstringNoThe id of the guild

getActiveThreads(guildId)

:

Promise<discord_api_types_v10.APIThreadList>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the active threads from

getAuditLogs(guildId, options?)

:

Promise<discord_api_types_v10.APIAuditLog>

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>

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>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the auto moderation rules from

getChannels(guildId)

:

Promise<RESTGetAPIGuildChannelsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the channels from

getEmoji(guildId, emojiId)

:

Promise<discord_api_types_v10.APIEmoji>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the emoji from
emojiIdSnowflakeNoThe id of the emoji to fetch

getEmojis(guildId)

:

Promise<RESTGetAPIGuildEmojisResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the emojis from

getIntegrations(guildId)

:

Promise<RESTGetAPIGuildIntegrationsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the integrations from

getInvites(guildId)

:

Promise<RESTGetAPIGuildInvitesResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the invites from

getMember(guildId, userId)

:

Promise<discord_api_types_v10.APIGuildMember>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild
userIdSnowflakeNoThe id of the user

getMemberBans(guildId)

:

Promise<RESTGetAPIGuildBansResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the ban from

getMembers(guildId, options?)

:

Promise<discord_api_types_v10.APIGuildMember>

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

getPreview(guildId)

:

Promise<discord_api_types_v10.APIGuildPreview>

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>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the roles from

getScheduledEvent(guildId, eventId, options?)

:

Promise<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
optionsRESTGetAPIGuildScheduledEventQueryYesThe options for fetching the scheduled event

getScheduledEvents(guildId, options?)

:

Promise<RESTGetAPIGuildScheduledEventsResult>

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>

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>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the sticker from
stickerIdSnowflakeNoThe id of the sticker to fetch

getStickers(guildId)

:

Promise<RESTGetAPIGuildStickersResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the stickers from

getTemplate(templateCode)

:

Promise<discord_api_types_v10.APITemplate>

NameTypeOptionalDescription
templateCodestringNoThe code of the template

getTemplates(guildId)

:

Promise<RESTGetAPIGuildTemplatesResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the templates from

getVanityURL(guildId)

:

Promise<RESTGetAPIGuildVanityUrlResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the vanity url from

getVoiceRegions(guildId)

:

Promise<RESTGetAPIGuildVoiceRegionsResult>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the voice regions from

getWelcomeScreen(guildId)

:

Promise<discord_api_types_v10.APIGuildWelcomeScreen>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the welcome screen from

getWidget(guildId)

:

Promise<discord_api_types_v10.APIGuildWidget>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget from

getWidgetImage(guildId, style?)

:

Promise<ArrayBuffer>

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

getWidgetSettings(guildId)

:

Promise<ArrayBuffer>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to fetch the widget settings from

removeRoleFromMember(guildId, userId, roleId, reason?)

:

Promise<void>

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>

NameTypeOptionalDescription
guildIdSnowflakeNoThe id of the guild to search in
optionsRESTGetAPIGuildMembersSearchQueryNoNone

setChannelPositions(guildId, data, reason?)

:

Promise<void>

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>

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>

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

unbanUser(guildId, userId, reason?)

:

Promise<void>

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