Skip to content

REST

Constructors

new REST()

new REST(token?): REST

Parameters

ParameterType
token?string

Returns

REST

Defined in

http/rest.ts:58

Properties

BaseURL

readonly static BaseURL: "https://discord.com/api/v10/" = "https://discord.com/api/v10/"

Defined in

http/rest.ts:54

Methods

makeAPIRequest()

makeAPIRequest(method, path, data, reason)

makeAPIRequest<T>(method, path, data, reason?): Promise<T>

Type Parameters
Type Parameter
T
Parameters
ParameterType
method"GET" | "POST" | "PATCH" | "DELETE" | "PUT"
pathstring
dataFormData
reason?string
Returns

Promise<T>

Defined in

http/rest.ts:62

makeAPIRequest(method, path, data, files)

makeAPIRequest<T>(method, path, data?, files?): Promise<T>

Type Parameters
Type Parameter
T
Parameters
ParameterType
method"GET" | "POST" | "PATCH" | "DELETE" | "PUT"
pathstring
data?Record<string, any>
files?LilybirdAttachment[]
Returns

Promise<T>

Defined in

http/rest.ts:63


setToken()

setToken(token): void

Parameters

ParameterType
tokenundefined | string

Returns

void

Defined in

http/rest.ts:131


getGateway()

getGateway(): Promise<object>

Returns

Promise<object>

url

url: string

Defined in

http/rest.ts:136


getGatewayBot()

getGatewayBot(): Promise<GetGatewayBotResponse>

Returns

Promise<GetGatewayBotResponse>

Defined in

http/rest.ts:140


getGlobalApplicationCommands()

getGlobalApplicationCommands(clientId)

getGlobalApplicationCommands(clientId): Promise<GlobalStructure[]>

Parameters
ParameterType
clientIdstring
Returns

Promise<GlobalStructure[]>

Defined in

http/rest.ts:146

getGlobalApplicationCommands(clientId, withLocalizations)

getGlobalApplicationCommands(clientId, withLocalizations): Promise<GlobalStructure[]>

Parameters
ParameterType
clientIdstring
withLocalizationstrue
Returns

Promise<GlobalStructure[]>

Defined in

http/rest.ts:147


createGlobalApplicationCommand()

createGlobalApplicationCommand(clientId, body): Promise<GlobalStructure>

Parameters

ParameterType
clientIdstring
bodyApplicationCommandJSONParams

Returns

Promise<GlobalStructure>

Defined in

http/rest.ts:152


getGlobalApplicationCommand()

getGlobalApplicationCommand(clientId, commandId): Promise<GlobalStructure>

Parameters

ParameterType
clientIdstring
commandIdstring

Returns

Promise<GlobalStructure>

Defined in

http/rest.ts:156


editGlobalApplicationCommand()

editGlobalApplicationCommand(clientId, commandId, body): Promise<GlobalStructure>

Parameters

ParameterType
clientIdstring
commandIdstring
bodyPartial<ApplicationCommandJSONParams>

Returns

Promise<GlobalStructure>

Defined in

http/rest.ts:160


deleteGlobalApplicationCommand()

deleteGlobalApplicationCommand(clientId, commandId): Promise<null>

Parameters

ParameterType
clientIdstring
commandIdstring

Returns

Promise<null>

Defined in

http/rest.ts:168


bulkOverwriteGlobalApplicationCommand()

bulkOverwriteGlobalApplicationCommand(clientId, body): Promise<GlobalStructure[]>

Parameters

ParameterType
clientIdstring
bodyApplicationCommandJSONParams[]

Returns

Promise<GlobalStructure[]>

Defined in

http/rest.ts:172


getGuildApplicationCommands()

getGuildApplicationCommands(clientId)

getGuildApplicationCommands(clientId): Promise<GuildStructure[]>

Parameters
ParameterType
clientIdstring
Returns

Promise<GuildStructure[]>

Defined in

http/rest.ts:176

getGuildApplicationCommands(clientId, withLocalizations)

getGuildApplicationCommands(clientId, withLocalizations): Promise<GuildStructure[]>

Parameters
ParameterType
clientIdstring
withLocalizationstrue
Returns

Promise<GuildStructure[]>

Defined in

http/rest.ts:177


createGuildApplicationCommand()

createGuildApplicationCommand(clientId, guildId, body): Promise<GuildStructure>

Parameters

ParameterType
clientIdstring
guildIdstring
bodyApplicationCommandJSONParams

Returns

Promise<GuildStructure>

Defined in

http/rest.ts:182


getGuildApplicationCommand()

getGuildApplicationCommand(clientId, guildId, commandId): Promise<GuildStructure>

Parameters

ParameterType
clientIdstring
guildIdstring
commandIdstring

Returns

Promise<GuildStructure>

Defined in

http/rest.ts:186


editGuildApplicationCommand()

editGuildApplicationCommand(clientId, guildId, commandId, body): Promise<GuildStructure>

Parameters

ParameterType
clientIdstring
guildIdstring
commandIdstring
bodyPartial<ApplicationCommandJSONParams>

Returns

Promise<GuildStructure>

Defined in

http/rest.ts:190


deleteGuildApplicationCommand()

deleteGuildApplicationCommand(clientId, guildId, commandId): Promise<null>

Parameters

ParameterType
clientIdstring
guildIdstring
commandIdstring

Returns

Promise<null>

Defined in

http/rest.ts:199


bulkOverwriteGuildApplicationCommand()

bulkOverwriteGuildApplicationCommand(clientId, guildId, body): Promise<GuildStructure[]>

Parameters

ParameterType
clientIdstring
guildIdstring
bodyApplicationCommandJSONParams[]

Returns

Promise<GuildStructure[]>

Defined in

http/rest.ts:203


getGuildApplicationCommandPermissions()

getGuildApplicationCommandPermissions(clientId, guildId): Promise<GuildPermissionsStructure[]>

Parameters

ParameterType
clientIdstring
guildIdstring

Returns

Promise<GuildPermissionsStructure[]>

Defined in

http/rest.ts:211


getApplicationCommandPermissions()

getApplicationCommandPermissions(clientId, guildId, commandId): Promise<GuildPermissionsStructure>

Parameters

ParameterType
clientIdstring
guildIdstring
commandIdstring

Returns

Promise<GuildPermissionsStructure>

Defined in

http/rest.ts:215


editApplicationCommandPermissions()

editApplicationCommandPermissions(clientId, guildId, commandId, body): Promise<GuildPermissionsStructure>

Parameters

ParameterType
clientIdstring
guildIdstring
commandIdstring
bodyobject
body.permissionsPermissionsStructure[]

Returns

Promise<GuildPermissionsStructure>

Defined in

http/rest.ts:219


createInteractionResponse()

createInteractionResponse(interactionId, interactionToken, body, files?): Promise<null>

Parameters

ParameterType
interactionIdstring
interactionTokenstring
bodyResponseJSONParams
files?LilybirdAttachment[]

Returns

Promise<null>

Defined in

http/rest.ts:230


getOriginalInteractionResponse()

getOriginalInteractionResponse(clientId, interactionToken): Promise<Structure>

Parameters

ParameterType
clientIdstring
interactionTokenstring

Returns

Promise<Structure>

Defined in

http/rest.ts:234


editOriginalInteractionResponse()

editOriginalInteractionResponse(clientId, interactionToken, body, files?): Promise<Structure>

Parameters

ParameterType
clientIdstring
interactionTokenstring
bodyEditWebhookJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:238


deleteOriginalInteractionResponse()

deleteOriginalInteractionResponse(clientId, interactionToken): Promise<null>

Parameters

ParameterType
clientIdstring
interactionTokenstring

Returns

Promise<null>

Defined in

http/rest.ts:242


createFollowupMessage()

createFollowupMessage(clientId, interactionToken, body, files?): Promise<Structure>

Parameters

ParameterType
clientIdstring
interactionTokenstring
bodyExecuteWebhookJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:246


getFollowupMessage()

getFollowupMessage(clientId, interactionToken, messageId): Promise<Structure>

Parameters

ParameterType
clientIdstring
interactionTokenstring
messageIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:250


editFollowupMessage()

editFollowupMessage(clientId, interactionToken, messageId, body, files?): Promise<Structure>

Parameters

ParameterType
clientIdstring
interactionTokenstring
messageIdstring
bodyEditWebhookJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:254


deleteFollowupMessage()

deleteFollowupMessage(clientId, interactionToken, messageId): Promise<null>

Parameters

ParameterType
clientIdstring
interactionTokenstring
messageIdstring

Returns

Promise<null>

Defined in

http/rest.ts:258


getCurrentApplication()

getCurrentApplication(): Promise<Structure>

Returns

Promise<Structure>

Defined in

http/rest.ts:264


editCurrentApplication()

editCurrentApplication(app): Promise<Structure>

Parameters

ParameterType
appEditApplicationJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:268


getApplicationRoleConnectionMetadataRecords()

getApplicationRoleConnectionMetadataRecords(applicationId): Promise<RoleConnectionMetadataStructure[]>

Parameters

ParameterType
applicationIdstring

Returns

Promise<RoleConnectionMetadataStructure[]>

Defined in

http/rest.ts:274


updateApplicationRoleConnectionMetadataRecords()

updateApplicationRoleConnectionMetadataRecords(applicationId): Promise<RoleConnectionMetadataStructure[]>

Parameters

ParameterType
applicationIdstring

Returns

Promise<RoleConnectionMetadataStructure[]>

Defined in

http/rest.ts:278


getGuildAuditLog()

getGuildAuditLog(guildId, params): Promise<Structure>

Parameters

ParameterType
guildIdstring
paramsobject
params.user_id?string
params.action_type?AuditLogEvent
params.before?string
params.after?string
params.limit?number

Returns

Promise<Structure>

Defined in

http/rest.ts:284


listAutoModerationRulesForGuild()

listAutoModerationRulesForGuild(guildId): Promise<RuleStructure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<RuleStructure[]>

Defined in

http/rest.ts:312


getAutoModerationRule()

getAutoModerationRule(guildId, ruleId): Promise<RuleStructure>

Parameters

ParameterType
guildIdstring
ruleIdstring

Returns

Promise<RuleStructure>

Defined in

http/rest.ts:316


createAutoModerationRule()

createAutoModerationRule(guildId, rule): Promise<RuleStructure>

Parameters

ParameterType
guildIdstring
ruleCreateJSONParams

Returns

Promise<RuleStructure>

Defined in

http/rest.ts:320


modifyAutoModerationRule()

modifyAutoModerationRule(guildId, ruleId, rule): Promise<RuleStructure>

Parameters

ParameterType
guildIdstring
ruleIdstring
rulePartial<Omit<CreateJSONParams, "trigger_type">>

Returns

Promise<RuleStructure>

Defined in

http/rest.ts:324


deleteAutoModerationRule()

deleteAutoModerationRule(guildId, ruleId, reason): Promise<null>

Parameters

ParameterType
guildIdstring
ruleIdstring
reasonstring

Returns

Promise<null>

Defined in

http/rest.ts:328


getChannel()

getChannel(channelId): Promise<Structure>

Parameters

ParameterType
channelIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:334


modifyChannel()

modifyChannel(channelId, body): Promise<Structure>

Parameters

ParameterType
channelIdstring
bodyDMChannelStructure | GuildChannelStructure | ThreadChannelStructure

Returns

Promise<Structure>

Defined in

http/rest.ts:338


deleteChannel()

deleteChannel(channelId, reason?): Promise<Structure>

Parameters

ParameterType
channelIdstring
reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:342


editChannelPermissions()

editChannelPermissions(channelId, overwriteId, params): Promise<null>

Parameters

ParameterTypeDescription
channelIdstring-
overwriteIdstring-
paramsobject-
params.reason?string-
params.allow?null | string-
params.deny?null | string-
params.type0 | 10 for a role or 1 for a member

Returns

Promise<null>

Defined in

http/rest.ts:346


getChannelInvites()

getChannelInvites(channelId): Promise<Structure[]>

Parameters

ParameterType
channelIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:360


createChannelInvite()

createChannelInvite(channelId, body): Promise<Structure>

Parameters

ParameterType
channelIdstring
bodyCreateJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:364


deleteChannelPermission()

deleteChannelPermission(channelId, overwriteId, reason?): Promise<null>

Parameters

ParameterType
channelIdstring
overwriteIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:368


followAnnouncementChannel()

followAnnouncementChannel(channelId, body): Promise<FollowedChannelStructure>

Parameters

ParameterType
channelIdstring
bodyobject
body.webhook_channel_id?string

Returns

Promise<FollowedChannelStructure>

Defined in

http/rest.ts:372


triggerTypingIndicator()

triggerTypingIndicator(channelId): Promise<null>

Parameters

ParameterType
channelIdstring

Returns

Promise<null>

Defined in

http/rest.ts:376


getPinnedMessages()

getPinnedMessages(channelId): Promise<null>

Parameters

ParameterType
channelIdstring

Returns

Promise<null>

Defined in

http/rest.ts:380


pinMessage()

pinMessage(channelId, messageId, reason?): Promise<null>

Parameters

ParameterType
channelIdstring
messageIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:384


unpinMessage()

unpinMessage(channelId, messageId, reason?): Promise<null>

Parameters

ParameterType
channelIdstring
messageIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:388


groupDMAddRecipient()

groupDMAddRecipient(channelId, userId, body): Promise<null>

Parameters

ParameterType
channelIdstring
userIdstring
bodyobject
body.access_tokenstring
body.nickstring

Returns

Promise<null>

Defined in

http/rest.ts:392


groupDMRemoveRecipient()

groupDMRemoveRecipient(channelId, userId): Promise<null>

Parameters

ParameterType
channelIdstring
userIdstring

Returns

Promise<null>

Defined in

http/rest.ts:396


startThreadFromMessage()

startThreadFromMessage(channelId, messageId, body): Promise<Structure>

Parameters

ParameterType
channelIdstring
messageIdstring
bodyThreadFromMessageJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:400


startThreadWithoutMessage()

startThreadWithoutMessage(channelId, body): Promise<Structure>

Parameters

ParameterType
channelIdstring
bodyThreadJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:404


startThreadInForumOrMediaChannel()

startThreadInForumOrMediaChannel(channelId, body, files?): Promise<Structure>

Parameters

ParameterType
channelIdstring
bodyForumMediaThreadJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:408


joinThread()

joinThread(channelId): Promise<null>

Parameters

ParameterType
channelIdstring

Returns

Promise<null>

Defined in

http/rest.ts:412


addThreadMember()

addThreadMember(channelId, userId): Promise<null>

Parameters

ParameterType
channelIdstring
userIdstring

Returns

Promise<null>

Defined in

http/rest.ts:416


leaveThread()

leaveThread(channelId): Promise<null>

Parameters

ParameterType
channelIdstring

Returns

Promise<null>

Defined in

http/rest.ts:420


removeThreadMember()

removeThreadMember(channelId, userId): Promise<null>

Parameters

ParameterType
channelIdstring
userIdstring

Returns

Promise<null>

Defined in

http/rest.ts:424


getThreadMember()

getThreadMember(channelId, userId, withMember): Promise<ThreadMemberStructure>

Parameters

ParameterTypeDefault value
channelIdstringundefined
userIdstringundefined
withMemberbooleanfalse

Returns

Promise<ThreadMemberStructure>

Defined in

http/rest.ts:428


listThreadMembers()

listThreadMembers(channelId, params): Promise<ThreadMemberStructure[]>

Parameters

ParameterType
channelIdstring
paramsobject
params.after?number
params.limit?string

Returns

Promise<ThreadMemberStructure[]>

Defined in

http/rest.ts:432


listPublicArchivedThreads()

listPublicArchivedThreads(channelId, params): Promise<ListArchivedThreadsReturnStructure>

Parameters

ParameterType
channelIdstring
paramsobject
params.before?string
params.limit?string

Returns

Promise<ListArchivedThreadsReturnStructure>

Defined in

http/rest.ts:443


listPrivateArchivedThreads()

listPrivateArchivedThreads(channelId, params): Promise<ListArchivedThreadsReturnStructure>

Parameters

ParameterType
channelIdstring
paramsobject
params.before?string
params.limit?string

Returns

Promise<ListArchivedThreadsReturnStructure>

Defined in

http/rest.ts:454


listJoinedPrivateArchivedThreads()

listJoinedPrivateArchivedThreads(channelId, params): Promise<ListArchivedThreadsReturnStructure>

Parameters

ParameterType
channelIdstring
paramsobject
params.before?string
params.limit?string

Returns

Promise<ListArchivedThreadsReturnStructure>

Defined in

http/rest.ts:465


listGuildEmojis()

listGuildEmojis(guildId): Promise<Structure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:478


getGuildEmoji()

getGuildEmoji(guildId, emojiId): Promise<Structure>

Parameters

ParameterType
guildIdstring
emojiIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:482


createGuildEmoji()

createGuildEmoji(guildId, params): Promise<Structure>

Parameters

ParameterType
guildIdstring
paramsobject
params.namestring
params.imageImageData
params.rolesstring[]
params.reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:486


modifyGuildEmoji()

modifyGuildEmoji(guildId, emojiId, params): Promise<Structure>

Parameters

ParameterType
guildIdstring
emojiIdstring
paramsobject
params.name?string
params.roles?null | string[]
params.reasonstring

Returns

Promise<Structure>

Defined in

http/rest.ts:490


deleteGuildEmoji()

deleteGuildEmoji(guildId, emojiId, reason?): Promise<null>

Parameters

ParameterType
guildIdstring
emojiIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:494


listApplicationEmojis()

listApplicationEmojis(applicationId): Promise<Structure[]>

Parameters

ParameterType
applicationIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:498


getApplicationEmoji()

getApplicationEmoji(applicationId, emojiId): Promise<Structure>

Parameters

ParameterType
applicationIdstring
emojiIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:502


createApplicationEmoji()

createApplicationEmoji(applicationId, params): Promise<Structure>

Parameters

ParameterType
applicationIdstring
paramsobject
params.namestring
params.imageImageData

Returns

Promise<Structure>

Defined in

http/rest.ts:506


modifyApplicationEmoji()

modifyApplicationEmoji(applicationId, emojiId, params): Promise<Structure>

Parameters

ParameterType
applicationIdstring
emojiIdstring
paramsobject
params.namestring

Returns

Promise<Structure>

Defined in

http/rest.ts:510


deleteApplicationEmoji()

deleteApplicationEmoji(applicationId, emojiId): Promise<null>

Parameters

ParameterType
applicationIdstring
emojiIdstring

Returns

Promise<null>

Defined in

http/rest.ts:514


createGuild()

createGuild(body): Promise<Structure>

Parameters

ParameterType
bodyGuildJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:520


getGuild()

getGuild(guildId, withCounts): Promise<Structure>

Parameters

ParameterTypeDefault value
guildIdstringundefined
withCountsbooleanfalse

Returns

Promise<Structure>

Defined in

http/rest.ts:524


getGuildPreview()

getGuildPreview(guildId): Promise<PreviewStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<PreviewStructure>

Defined in

http/rest.ts:528


modifyGuild()

modifyGuild(guildId, body): Promise<Structure>

Parameters

ParameterType
guildIdstring
bodyGuildJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:532


deleteGuild()

deleteGuild(guildId): Promise<null>

Parameters

ParameterType
guildIdstring

Returns

Promise<null>

Defined in

http/rest.ts:536


getGuildChannels()

getGuildChannels(guildId): Promise<Structure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:540


createGuildChannel()

createGuildChannel(guildId, body): Promise<Structure>

Parameters

ParameterType
guildIdstring
bodyGuildChannelJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:544


modifyGuildChannelPositions()

modifyGuildChannelPositions(guildId, body): Promise<Structure>

Parameters

ParameterType
guildIdstring
bodyChannelPositionJSONParams[]

Returns

Promise<Structure>

Defined in

http/rest.ts:548


listActiveGuildThreads()

listActiveGuildThreads(guildId): Promise<object>

Parameters

ParameterType
guildIdstring

Returns

Promise<object>

threads

threads: ThreadChannelStructure[]

members

members: ThreadMemberStructure[]

Defined in

http/rest.ts:552


getGuildMember()

getGuildMember(guildId, userId): Promise<MemberStructure>

Parameters

ParameterType
guildIdstring
userIdstring

Returns

Promise<MemberStructure>

Defined in

http/rest.ts:559


listGuildMembers()

listGuildMembers(guildId, params): Promise<MemberStructure[]>

Parameters

ParameterType
guildIdstring
paramsobject
params.limitnumber
params.afterstring

Returns

Promise<MemberStructure[]>

Defined in

http/rest.ts:563


searchGuildMembers()

searchGuildMembers(guildId, params): Promise<MemberStructure[]>

Parameters

ParameterType
guildIdstring
paramsobject
params.querystring
params.limitnumber

Returns

Promise<MemberStructure[]>

Defined in

http/rest.ts:574


addGuildMember()

addGuildMember(guildId, userId, body): Promise<null | MemberStructure>

Parameters

ParameterType
guildIdstring
userIdstring
bodyobject
body.access_tokenstring
body.nick?string
body.roles?string[]
body.mute?boolean
body.deaf?boolean

Returns

Promise<null | MemberStructure>

Defined in

http/rest.ts:585


modifyGuildMember()

modifyGuildMember(guildId, userId, body): Promise<MemberStructure>

Parameters

ParameterTypeDescription
guildIdstring-
userIdstring-
bodyobject-
body.reason?null | string-
body.nick?null | string-
body.roles?null | string[]-
body.mute?null | boolean-
body.deaf?null | boolean-
body.channel_id?null | string-
body.communication_disabled_until?null | stringISO8601 timestamp
body.flags?null | number-

Returns

Promise<MemberStructure>

Defined in

http/rest.ts:599


modifyCurrentMember()

modifyCurrentMember(guildId, body): Promise<MemberStructure>

Parameters

ParameterType
guildIdstring
bodyobject
body.reason?null | string
body.nick?null | string

Returns

Promise<MemberStructure>

Defined in

http/rest.ts:617


addGuildMemberRole()

addGuildMemberRole(guildId, userId, roleId, reason): Promise<null>

Parameters

ParameterType
guildIdstring
userIdstring
roleIdstring
reasonstring

Returns

Promise<null>

Defined in

http/rest.ts:627


removeGuildMemberRole()

removeGuildMemberRole(guildId, userId, roleId, reason): Promise<null>

Parameters

ParameterType
guildIdstring
userIdstring
roleIdstring
reasonstring

Returns

Promise<null>

Defined in

http/rest.ts:631


removeGuildMember()

removeGuildMember(guildId, userId, reason): Promise<null>

Parameters

ParameterType
guildIdstring
userIdstring
reasonstring

Returns

Promise<null>

Defined in

http/rest.ts:635


getGuildBans()

getGuildBans(guildId, params): Promise<BanStructure[]>

Parameters

ParameterType
guildIdstring
paramsobject
params.beforestring
params.afterstring
params.limitstring

Returns

Promise<BanStructure[]>

Defined in

http/rest.ts:639


getGuildBan()

getGuildBan(guildId, userId): Promise<BanStructure>

Parameters

ParameterType
guildIdstring
userIdstring

Returns

Promise<BanStructure>

Defined in

http/rest.ts:660


createGuildBan()

createGuildBan(guildId, userId, body): Promise<null>

Parameters

ParameterType
guildIdstring
userIdstring
bodyobject
body.reason?string
body.delete_message_seconds?number

Returns

Promise<null>

Defined in

http/rest.ts:664


removeGuildBan()

removeGuildBan(guildId, userId, reason?): Promise<null>

Parameters

ParameterType
guildIdstring
userIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:675


getGuildRoles()

getGuildRoles(guildId): Promise<Structure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:679


getGuildRole()

getGuildRole(guildId, roleId): Promise<Structure>

Parameters

ParameterType
guildIdstring
roleIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:683


createGuildRole()

createGuildRole(guildId, body): Promise<Structure>

Parameters

ParameterType
guildIdstring
bodyJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:687


modifyGuildRolePosition()

modifyGuildRolePosition(guildId, body): Promise<Structure[]>

Parameters

ParameterType
guildIdstring
bodyobject
body.reason?string
body.idstring
body.position?null | number

Returns

Promise<Structure[]>

Defined in

http/rest.ts:691


modifyGuildRole()

modifyGuildRole(guildId, roleId, body): Promise<Structure>

Parameters

ParameterType
guildIdstring
roleIdstring
bodyPartial<JSONParams>

Returns

Promise<Structure>

Defined in

http/rest.ts:695


modifyGuildMFALevel()

modifyGuildMFALevel(guildId, level): Promise<MFALevel>

Parameters

ParameterType
guildIdstring
levelMFALevel

Returns

Promise<MFALevel>

Defined in

http/rest.ts:699


deleteGuildRole()

deleteGuildRole(guildId, roleId, reason?): Promise<null>

Parameters

ParameterType
guildIdstring
roleIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:703


getGuildPruneCount()

getGuildPruneCount(guildId, params): Promise<object>

Parameters

ParameterType
guildIdstring
paramsobject
params.daysnumber
params.include_roles?string

Returns

Promise<object>

pruned

pruned: number

Defined in

http/rest.ts:707


beginGuildPrune()

beginGuildPrune(guildId, body): Promise<object>

Parameters

ParameterType
guildIdstring
bodyobject
body.days?number
body.compute_prune_count?boolean
body.include_roles?string[]
body.reason?string

Returns

Promise<object>

pruned

pruned: null | number

Defined in

http/rest.ts:718


getGuildVoiceRegions()

getGuildVoiceRegions(guildId): Promise<RegionStructure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<RegionStructure[]>

Defined in

http/rest.ts:730


getGuildInvites()

getGuildInvites(guildId): Promise<Structure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:734


getGuildIntegrations()

getGuildIntegrations(guildId): Promise<IntegrationStructure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<IntegrationStructure[]>

Defined in

http/rest.ts:738


deleteGuildIntegration()

deleteGuildIntegration(guildId, integrationId, reason?): Promise<null>

Parameters

ParameterType
guildIdstring
integrationIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:742


getGuildWidgetSettings()

getGuildWidgetSettings(guildId): Promise<WidgetSettingsStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<WidgetSettingsStructure>

Defined in

http/rest.ts:746


modifyGuildWidget()

modifyGuildWidget(guildId, body): Promise<WidgetSettingsStructure>

Parameters

ParameterType
guildIdstring
bodyWidgetSettingsStructure & object

Returns

Promise<WidgetSettingsStructure>

Defined in

http/rest.ts:750


getGuildWidget()

getGuildWidget(guildId): Promise<WidgetStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<WidgetStructure>

Defined in

http/rest.ts:754


getGuildVanityUrl()

getGuildVanityUrl(guildId): Promise<Partial<Structure>>

Parameters

ParameterType
guildIdstring

Returns

Promise<Partial<Structure>>

Defined in

http/rest.ts:758


getGuildWidgetImage()

getGuildWidgetImage(guildId, style): Promise<string>

Yeah… this probably doesn’t work

Parameters

ParameterTypeDefault value
guildIdstringundefined
stylestring"shield"

Returns

Promise<string>

Defined in

http/rest.ts:763


getGuildWelcomeScreen()

getGuildWelcomeScreen(guildId): Promise<WelcomeScreenStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<WelcomeScreenStructure>

Defined in

http/rest.ts:767


modifyGuildWelcomeScreen()

modifyGuildWelcomeScreen(guildId, body): Promise<WelcomeScreenStructure>

Parameters

ParameterType
guildIdstring
bodyobject
body.reason?string
body.enabled?null | boolean
body.welcome_channels?null | WelcomeScreenChannelStructure[]
body.description?null | string

Returns

Promise<WelcomeScreenStructure>

Defined in

http/rest.ts:771


getGuildOnboarding()

getGuildOnboarding(guildId): Promise<OnboardingStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<OnboardingStructure>

Defined in

http/rest.ts:783


modifyGuildOnboarding()

modifyGuildOnboarding(guildId, body): Promise<OnboardingStructure>

Parameters

ParameterType
guildIdstring
bodyobject
body.reason?string
body.promptsOnboardingPromptStructure[]
body.default_channel_idsstring[]
body.enabledboolean
body.modeOnboardingMode

Returns

Promise<OnboardingStructure>

Defined in

http/rest.ts:787


modifyCurrentUserVoiceState()

modifyCurrentUserVoiceState(guildId, body): Promise<null>

Parameters

ParameterType
guildIdstring
bodyobject
body.channel_id?string
body.suppress?boolean
body.request_to_speak_timestamp?null | string

Returns

Promise<null>

Defined in

http/rest.ts:800


modifyUserVoiceState()

modifyUserVoiceState(guildId, userId, body): Promise<null>

Parameters

ParameterType
guildIdstring
userIdstring
bodyobject
body.channel_idstring
body.suppress?boolean

Returns

Promise<null>

Defined in

http/rest.ts:811


listScheduledEventsForGuild()

listScheduledEventsForGuild(guildId, params): Promise<ScheduledEventStructure[]>

Parameters

ParameterType
guildIdstring
paramsobject
params.with_user_count?boolean

Returns

Promise<ScheduledEventStructure[]>

Defined in

http/rest.ts:824


createGuildScheduledEvent()

createGuildScheduledEvent(guildId, event): Promise<ScheduledEventStructure>

Parameters

ParameterType
guildIdstring
eventScheduledEventJSONParams

Returns

Promise<ScheduledEventStructure>

Defined in

http/rest.ts:832


getGuildScheduledEvent()

getGuildScheduledEvent(guildId, eventId, params): Promise<ScheduledEventStructure[]>

Parameters

ParameterType
guildIdstring
eventIdstring
paramsobject
params.with_user_count?boolean

Returns

Promise<ScheduledEventStructure[]>

Defined in

http/rest.ts:836


modifyGuildScheduledEvent()

modifyGuildScheduledEvent(guildId, eventId, event): Promise<ScheduledEventStructure>

Parameters

ParameterType
guildIdstring
eventIdstring
eventPartial<ScheduledEventJSONParams>

Returns

Promise<ScheduledEventStructure>

Defined in

http/rest.ts:844


deleteGuildScheduledEvent()

deleteGuildScheduledEvent(guildId, eventId): Promise<null>

Parameters

ParameterType
guildIdstring
eventIdstring

Returns

Promise<null>

Defined in

http/rest.ts:848


getGuildScheduledEventUsers()

getGuildScheduledEventUsers(guildId, eventId, params): Promise<object>

Parameters

ParameterType
guildIdstring
eventIdstring
paramsobject
params.limit?number
params.with_member?boolean
params.before?string
params.after?string

Returns

Promise<object>

guild_scheduled_event_id

guild_scheduled_event_id: string

user

user: Structure

member?

optional member: MemberStructure

Defined in

http/rest.ts:852


getGuildTemplate()

getGuildTemplate(templateCode): Promise<TemplateStructure>

Parameters

ParameterType
templateCodestring

Returns

Promise<TemplateStructure>

Defined in

http/rest.ts:876


createGuildFromGuildTemplate()

createGuildFromGuildTemplate(templateCode, guild): Promise<Structure>

Parameters

ParameterType
templateCodestring
guildobject
guild.namestring
guild.image?ImageData

Returns

Promise<Structure>

Defined in

http/rest.ts:880


getGuildTemplates()

getGuildTemplates(guildId): Promise<TemplateStructure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<TemplateStructure[]>

Defined in

http/rest.ts:884


createGuildTemplate()

createGuildTemplate(guildId, template): Promise<TemplateStructure>

Parameters

ParameterType
guildIdstring
templateobject
template.namestring
template.description?null | string

Returns

Promise<TemplateStructure>

Defined in

http/rest.ts:888


syncGuildTemplate()

syncGuildTemplate(guildId, templateCode): Promise<TemplateStructure[]>

Parameters

ParameterType
guildIdstring
templateCodestring

Returns

Promise<TemplateStructure[]>

Defined in

http/rest.ts:892


modifyGuildTemplate()

modifyGuildTemplate(guildId, templateCode, template): Promise<TemplateStructure>

Parameters

ParameterType
guildIdstring
templateCodestring
templateobject
template.name?string
template.description?null | string

Returns

Promise<TemplateStructure>

Defined in

http/rest.ts:896


deleteGuildTemplate()

deleteGuildTemplate(guildId, templateCode): Promise<TemplateStructure>

Parameters

ParameterType
guildIdstring
templateCodestring

Returns

Promise<TemplateStructure>

Defined in

http/rest.ts:900


getInvite()

getInvite(inviteCode): Promise<Structure>

Parameters

ParameterType
inviteCodestring

Returns

Promise<Structure>

Defined in

http/rest.ts:906


deleteInvite()

deleteInvite(inviteCode, reason?): Promise<Structure>

Parameters

ParameterType
inviteCodestring
reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:910


getChannelMessages()

getChannelMessages(channelId, params): Promise<Structure[]>

Parameters

ParameterTypeDescription
channelIdstring-
paramsobject-
params.around?string-
params.before?string-
params.after?string-
params.limit?number0-100 Default 50

Returns

Promise<Structure[]>

Defined in

http/rest.ts:916


getChannelMessage()

getChannelMessage(channelId, messageId): Promise<Structure>

Parameters

ParameterType
channelIdstring
messageIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:945


createMessage()

createMessage(channelId, body, files?): Promise<Structure>

Parameters

ParameterType
channelIdstring
bodyCreateJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:949


crosspostMessage()

crosspostMessage(channelId, messageId): Promise<Structure>

Parameters

ParameterType
channelIdstring
messageIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:953


createReaction()

createReaction(channelId, messageId, emoji, isCustom): Promise<null>

Parameters

ParameterTypeDefault value
channelIdstringundefined
messageIdstringundefined
emojistringundefined
isCustombooleanfalse

Returns

Promise<null>

Defined in

http/rest.ts:957


deleteOwnReaction()

deleteOwnReaction(channelId, messageId, emoji, isCustom): Promise<null>

Parameters

ParameterTypeDefault value
channelIdstringundefined
messageIdstringundefined
emojistringundefined
isCustombooleanfalse

Returns

Promise<null>

Defined in

http/rest.ts:962


deleteUserReaction()

deleteUserReaction(channelId, messageId, userId, emoji, isCustom): Promise<null>

Parameters

ParameterTypeDefault value
channelIdstringundefined
messageIdstringundefined
userIdstringundefined
emojistringundefined
isCustombooleanfalse

Returns

Promise<null>

Defined in

http/rest.ts:967


getReactions()

getReactions(channelId, messageId, emoji, isCustom, params): Promise<Structure[]>

Parameters

ParameterTypeDefault value
channelIdstringundefined
messageIdstringundefined
emojistringundefined
isCustombooleanfalse
paramsobject{}
params.after?numberundefined
params.limit?stringundefined

Returns

Promise<Structure[]>

Defined in

http/rest.ts:972


deleteAllReactions()

deleteAllReactions(channelId, messageId): Promise<null>

Parameters

ParameterType
channelIdstring
messageIdstring

Returns

Promise<null>

Defined in

http/rest.ts:985


deleteAllReactionsForEmoji()

deleteAllReactionsForEmoji(channelId, messageId, emoji, isCustom): Promise<null>

Parameters

ParameterTypeDefault value
channelIdstringundefined
messageIdstringundefined
emojistringundefined
isCustombooleanfalse

Returns

Promise<null>

Defined in

http/rest.ts:989


editMessage()

editMessage(channelId, messageId, body, files?): Promise<Structure>

Parameters

ParameterType
channelIdstring
messageIdstring
bodyEditJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:994


deleteMessage()

deleteMessage(channelId, messageId, reason?): Promise<null>

Parameters

ParameterType
channelIdstring
messageIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:998


bulkDeleteMessages()

bulkDeleteMessages(channelId, messageIds, reason?): Promise<null>

Parameters

ParameterType
channelIdstring
messageIdsstring[]
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:1002


getAnswerVoters()

getAnswerVoters(channelId, messageId, answerId, params): Promise<AnswerVotersStructure>

Parameters

ParameterTypeDescription
channelIdstring-
messageIdstring-
answerIdnumber-
paramsobject-
params.after?string-
params.limit?number0-100 Default 25

Returns

Promise<AnswerVotersStructure>

Defined in

http/rest.ts:1008


endPoll()

endPoll(channelId, messageId): Promise<Structure>

Parameters

ParameterType
channelIdstring
messageIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1031


createStageInstance()

createStageInstance(instance): Promise<Structure>

Parameters

ParameterType
instanceCreateJSONParams

Returns

Promise<Structure>

Defined in

http/rest.ts:1037


getStageInstance()

getStageInstance(channelId): Promise<Structure>

Parameters

ParameterType
channelIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1041


modifyStageInstance()

modifyStageInstance(channelId, data): Promise<Structure>

Parameters

ParameterType
channelIdstring
dataobject
data.topic?string
data.privacy_level?PrivacyLevel
data.reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1045


deleteStageInstance()

deleteStageInstance(channelId, reason?): Promise<null>

Parameters

ParameterType
channelIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:1049


getSticker()

getSticker(stickerId): Promise<Structure>

Parameters

ParameterType
stickerIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1055


listStickerPacks()

listStickerPacks(): Promise<object>

Returns

Promise<object>

sticker_packs

sticker_packs: PackStructure[]

Defined in

http/rest.ts:1059


getStickerPack()

getStickerPack(packId): Promise<PackStructure>

Parameters

ParameterType
packIdstring

Returns

Promise<PackStructure>

Defined in

http/rest.ts:1063


listGuildStickers()

listGuildStickers(guildId): Promise<Structure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:1067


getGuildSticker()

getGuildSticker(guildId, stickerId): Promise<Structure>

Parameters

ParameterType
guildIdstring
stickerIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1071


createGuildSticker()

createGuildSticker(guildId, stickerId, params): Promise<Structure>

Parameters

ParameterType
guildIdstring
stickerIdstring
paramsobject
params.namestring
params.descriptionstring
params.tagsstring
params.fileBlob
params.reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1075


modifyGuildSticker()

modifyGuildSticker(guildId, stickerId, params): Promise<Structure>

Parameters

ParameterType
guildIdstring
stickerIdstring
paramsobject
params.name?string
params.description?string
params.tags?string
params.reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1083


deleteGuildSticker()

deleteGuildSticker(guildId, stickerId, reason?): Promise<null>

Parameters

ParameterType
guildIdstring
stickerIdstring
reason?string

Returns

Promise<null>

Defined in

http/rest.ts:1087


getCurrentUser()

getCurrentUser(): Promise<Structure>

Returns

Promise<Structure>

Defined in

http/rest.ts:1093


getUser()

getUser(userId): Promise<Structure>

Parameters

ParameterType
userIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1097


modifyCurrentUser()

modifyCurrentUser(body?): Promise<Structure>

Parameters

ParameterType
body?object
body.username?string
body.avatar?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1101


getCurrentUserGuilds()

getCurrentUserGuilds(params): Promise<Partial<Structure>[]>

Parameters

ParameterType
paramsobject
params.beforestring
params.afterstring
params.limitstring
params.withCountsboolean

Returns

Promise<Partial<Structure>[]>

Defined in

http/rest.ts:1105


getCurrentUserGuildMember()

getCurrentUserGuildMember(guildId): Promise<MemberStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<MemberStructure>

Defined in

http/rest.ts:1127


leaveGuild()

leaveGuild(guildId): Promise<null>

Parameters

ParameterType
guildIdstring

Returns

Promise<null>

Defined in

http/rest.ts:1131


createDM()

createDM(userId): Promise<DMChannelStructure>

Parameters

ParameterType
userIdstring

Returns

Promise<DMChannelStructure>

Defined in

http/rest.ts:1135


createGroupDM()

createGroupDM(tokens, nicks): Promise<DMChannelStructure>

Parameters

ParameterType
tokensstring[]
nicksRecord<string, string>

Returns

Promise<DMChannelStructure>

Defined in

http/rest.ts:1139


listVoiceRegions()

listVoiceRegions(): Promise<RegionStructure[]>

Returns

Promise<RegionStructure[]>

Defined in

http/rest.ts:1145


getCurrentUserVoiceState()

getCurrentUserVoiceState(guildId): Promise<StateStructure>

Parameters

ParameterType
guildIdstring

Returns

Promise<StateStructure>

Defined in

http/rest.ts:1149


getUserVoiceState()

getUserVoiceState(guildId, userId): Promise<StateStructure>

Parameters

ParameterType
guildIdstring
userIdstring

Returns

Promise<StateStructure>

Defined in

http/rest.ts:1153


createWebhook()

createWebhook(channelId, webhook): Promise<Structure>

Parameters

ParameterType
channelIdstring
webhookobject
webhook.namestring
webhook.avatar?null | ImageData

Returns

Promise<Structure>

Defined in

http/rest.ts:1159


getChannelWebhooks()

getChannelWebhooks(channelId): Promise<Structure[]>

Parameters

ParameterType
channelIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:1163


getGuildWebhooks()

getGuildWebhooks(guildId): Promise<Structure[]>

Parameters

ParameterType
guildIdstring

Returns

Promise<Structure[]>

Defined in

http/rest.ts:1167


getWebhook()

getWebhook(webhookId): Promise<Structure>

Parameters

ParameterType
webhookIdstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1171


getWebhookWithToken()

getWebhookWithToken(webhookId, token): Promise<Structure>

Parameters

ParameterType
webhookIdstring
tokenstring

Returns

Promise<Structure>

Defined in

http/rest.ts:1175


modifyWebhook()

modifyWebhook(webhookId, webhook): Promise<Structure>

Parameters

ParameterType
webhookIdstring
webhookobject
webhook.name?string
webhook.avatar?null | ImageData
webhook.channel_id?string
webhook.reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1179


modifyWebhookWithToken()

modifyWebhookWithToken(webhookId, token, webhook): Promise<Structure>

Parameters

ParameterType
webhookIdstring
tokenstring
webhookobject
webhook.name?string
webhook.avatar?null | ImageData
webhook.channel_id?string
webhook.reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1183


deleteWebhook()

deleteWebhook(webhookId, reason?): Promise<Structure>

Parameters

ParameterType
webhookIdstring
reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1192


deleteWebhookWithToken()

deleteWebhookWithToken(webhookId, token, reason?): Promise<Structure>

Parameters

ParameterType
webhookIdstring
tokenstring
reason?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1196


executeWebhook()

executeWebhook(webhookId, token, params, body, files?): Promise<null | Structure>

Parameters

ParameterType
webhookIdstring
tokenstring
paramsobject
params.wait?boolean
params.thread_id?string
body?ExecuteWebhookJSONParams
files?LilybirdAttachment[]

Returns

Promise<null | Structure>

Defined in

http/rest.ts:1200


getWebhookMessage()

getWebhookMessage(webhookId, token, messageId, params): Promise<Structure>

Parameters

ParameterType
webhookIdstring
tokenstring
messageIdstring
paramsobject
params.thread_id?string

Returns

Promise<Structure>

Defined in

http/rest.ts:1218


editWebhookMessage()

editWebhookMessage(webhookId, token, messageId, params, body, files?): Promise<Structure>

Parameters

ParameterType
webhookIdstring
tokenstring
messageIdstring
paramsobject
params.thread_id?string
bodyEditWebhookJSONParams
files?LilybirdAttachment[]

Returns

Promise<Structure>

Defined in

http/rest.ts:1227


deleteWebhookMessage()

deleteWebhookMessage(webhookId, token, messageId, params): Promise<null>

Parameters

ParameterType
webhookIdstring
tokenstring
messageIdstring
paramsobject
params.thread_id?string

Returns

Promise<null>

Defined in

http/rest.ts:1243