Skip to main content
Module

x/discord_api_types/rest/v10/mod.ts

Up to date Discord API Typings, versioned by the API version
Go to Latest
File
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126
import type { Snowflake } from '../../globals.ts';
export * from '../common.ts';export * from './auditLog.ts';export * from './channel.ts';export * from './emoji.ts';export * from './gateway.ts';export * from './guild.ts';export * from './guildScheduledEvent.ts';export * from './interactions.ts';export * from './invite.ts';export * from './oauth2.ts';export * from './stageInstance.ts';export * from './sticker.ts';export * from './template.ts';export * from './user.ts';export * from './voice.ts';export * from './webhook.ts';
export const APIVersion = '10';
export const Routes = { /** * Route for: * - GET `/guilds/{guild.id}/audit-logs` */ guildAuditLog(guildId: Snowflake) { return `/guilds/${guildId}/audit-logs` as const; },
/** * Route for: * - GET `/channels/{channel.id}` * - PATCH `/channels/{channel.id}` * - DELETE `/channels/{channel.id}` */ channel(channelId: Snowflake) { return `/channels/${channelId}` as const; },
/** * Route for: * - GET `/channels/{channel.id}/messages` * - POST `/channels/{channel.id}/messages` */ channelMessages(channelId: Snowflake) { return `/channels/${channelId}/messages` as const; },
/** * Route for: * - GET `/channels/{channel.id}/messages/{message.id}` * - PATCH `/channels/{channel.id}/messages/{message.id}` * - DELETE `/channels/{channel.id}/messages/{message.id}` */ channelMessage(channelId: Snowflake, messageId: Snowflake) { return `/channels/${channelId}/messages/${messageId}` as const; },
/** * Route for: * - POST `/channels/{channel.id}/messages/{message.id}/crosspost` */ channelMessageCrosspost(channelId: Snowflake, messageId: Snowflake) { return `/channels/${channelId}/messages/${messageId}/crosspost` as const; },
/** * Route for: * - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me` * - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me` * * **Note**: You need to URL encode the emoji yourself */ channelMessageOwnReaction(channelId: Snowflake, messageId: Snowflake, emoji: string) { return `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/@me` as const; },
/** * Route for: * - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}` * * **Note**: You need to URL encode the emoji yourself */ channelMessageUserReaction(channelId: Snowflake, messageId: Snowflake, emoji: string, userId: Snowflake) { return `/channels/${channelId}/messages/${messageId}/reactions/${emoji}/${userId}` as const; },
/** * Route for: * - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}` * - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}` * * **Note**: You need to URL encode the emoji yourself */ channelMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string) { return `/channels/${channelId}/messages/${messageId}/reactions/${emoji}` as const; },
/** * Route for: * - DELETE `/channels/{channel.id}/messages/{message.id}/reactions` */ channelMessageAllReactions(channelId: Snowflake, messageId: Snowflake) { return `/channels/${channelId}/messages/${messageId}/reactions` as const; },
/** * Route for: * - POST `/channels/{channel.id}/messages/bulk-delete` */ channelBulkDelete(channelId: Snowflake) { return `/channels/${channelId}/messages/bulk-delete` as const; },
/** * Route for: * - PUT `/channels/{channel.id}/permissions/{overwrite.id}` * - DELETE `/channels/{channel.id}/permissions/{overwrite.id}` */ channelPermission(channelId: Snowflake, overwriteId: Snowflake) { return `/channels/${channelId}/permissions/${overwriteId}` as const; },
/** * Route for: * - GET `/channels/{channel.id}/invites` * - POST `/channels/{channel.id}/invites` */ channelInvites(channelId: Snowflake) { return `/channels/${channelId}/invites` as const; },
/** * Route for: * - POST `/channels/{channel.id}/followers` */ channelFollowers(channelId: Snowflake) { return `/channels/${channelId}/followers` as const; },
/** * Route for: * - POST `/channels/{channel.id}/typing` */ channelTyping(channelId: Snowflake) { return `/channels/${channelId}/typing` as const; },
/** * Route for: * - GET `/channels/{channel.id}/pins` */ channelPins(channelId: Snowflake) { return `/channels/${channelId}/pins` as const; },
/** * Route for: * - PUT `/channels/{channel.id}/pins/{message.id}` * - DELETE `/channels/{channel.id}/pins/{message.id}` */ channelPin(channelId: Snowflake, messageId: Snowflake) { return `/channels/${channelId}/pins/${messageId}` as const; },
/** * Route for: * - PUT `/channels/{channel.id}/recipients/{user.id}` * - DELETE `/channels/{channel.id}/recipients/{user.id}` */ channelRecipient(channelId: Snowflake, userId: Snowflake) { return `/channels/${channelId}/recipients/${userId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/emojis` * - POST `/guilds/{guild.id}/emojis` */ guildEmojis(guildId: Snowflake) { return `/guilds/${guildId}/emojis` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/emojis/{emoji.id}` * - PATCH `/guilds/{guild.id}/emojis/{emoji.id}` * - DELETE `/guilds/{guild.id}/emojis/{emoji.id}` */ guildEmoji(guildId: Snowflake, emojiId: Snowflake) { return `/guilds/${guildId}/emojis/${emojiId}` as const; },
/** * Route for: * - POST `/guilds` */ guilds() { return '/guilds' as const; },
/** * Route for: * - GET `/guilds/{guild.id}` * - PATCH `/guilds/{guild.id}` * - DELETE `/guilds/{guild.id}` */ guild(guildId: Snowflake) { return `/guilds/${guildId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/preview` */ guildPreview(guildId: Snowflake) { return `/guilds/${guildId}/preview` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/channels` * - POST `/guilds/{guild.id}/channels` * - PATCH `/guilds/{guild.id}/channels` */ guildChannels(guildId: Snowflake) { return `/guilds/${guildId}/channels` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/members/{user.id}` * - PUT `/guilds/{guild.id}/members/{user.id}` * - PATCH `/guilds/{guild.id}/members/@me` * - PATCH `/guilds/{guild.id}/members/{user.id}` * - DELETE `/guilds/{guild.id}/members/{user.id}` */ guildMember(guildId: Snowflake, userId: Snowflake | '@me' = '@me') { return `/guilds/${guildId}/members/${userId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/members` */ guildMembers(guildId: Snowflake) { return `/guilds/${guildId}/members` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/members/search` */ guildMembersSearch(guildId: Snowflake) { return `/guilds/${guildId}/members/search` as const; },
/** * Route for: * - PATCH `/guilds/{guild.id}/members/@me/nick` * @deprecated Use {@link Routes.guildMember} instead. */ guildCurrentMemberNickname(guildId: Snowflake) { return `/guilds/${guildId}/members/@me/nick` as const; },
/** * Route for: * - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}` * - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}` */ guildMemberRole(guildId: Snowflake, memberId: Snowflake, roleId: Snowflake) { return `/guilds/${guildId}/members/${memberId}/roles/${roleId}` as const; },
/** * Route for: * - POST `/guilds/{guild.id}/mfa` */ guildMFA(guildId: Snowflake) { return `/guilds/${guildId}/mfa` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/bans` */ guildBans(guildId: Snowflake) { return `/guilds/${guildId}/bans` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/bans/{user.id}` * - PUT `/guilds/{guild.id}/bans/{user.id}` * - DELETE `/guilds/{guild.id}/bans/{user.id}` */ guildBan(guildId: Snowflake, userId: Snowflake) { return `/guilds/${guildId}/bans/${userId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/roles` * - POST `/guilds/{guild.id}/roles` * - PATCH `/guilds/{guild.id}/roles` */ guildRoles(guildId: Snowflake) { return `/guilds/${guildId}/roles` as const; },
/** * Route for: * - PATCH `/guilds/{guild.id}/roles/{role.id}` * - DELETE `/guilds/{guild.id}/roles/{role.id}` */ guildRole(guildId: Snowflake, roleId: Snowflake) { return `/guilds/${guildId}/roles/${roleId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/prune` * - POST `/guilds/{guild.id}/prune` */ guildPrune(guildId: Snowflake) { return `/guilds/${guildId}/prune` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/regions` */ guildVoiceRegions(guildId: Snowflake) { return `/guilds/${guildId}/regions` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/invites` */ guildInvites(guildId: Snowflake) { return `/guilds/${guildId}/invites` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/integrations` */ guildIntegrations(guildId: Snowflake) { return `/guilds/${guildId}/integrations` as const; },
/** * Route for: * - DELETE `/guilds/{guild.id}/integrations/{integration.id}` */ guildIntegration(guildId: Snowflake, integrationId: Snowflake) { return `/guilds/${guildId}/integrations/${integrationId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/widget` * - PATCH `/guilds/{guild.id}/widget` */ guildWidgetSettings(guildId: Snowflake) { return `/guilds/${guildId}/widget` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/widget.json` */ guildWidgetJSON(guildId: Snowflake) { return `/guilds/${guildId}/widget.json` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/vanity-url` */ guildVanityUrl(guildId: Snowflake) { return `/guilds/${guildId}/vanity-url` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/widget.png` */ guildWidgetImage(guildId: Snowflake) { return `/guilds/${guildId}/widget.png` as const; },
/** * Route for: * - GET `/invites/{invite.code}` * - DELETE `/invites/{invite.code}` */ invite(code: string) { return `/invites/${code}` as const; },
/** * Route for: * - GET `/guilds/templates/{template.code}` * - POST `/guilds/templates/{template.code}` */ template(code: string) { return `/guilds/templates/${code}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/templates` * - POST `/guilds/{guild.id}/templates` */ guildTemplates(guildId: Snowflake) { return `/guilds/${guildId}/templates` as const; },
/** * Route for: * - PUT `/guilds/{guild.id}/templates/{template.code}` * - PATCH `/guilds/{guild.id}/templates/{template.code}` * - DELETE `/guilds/{guild.id}/templates/{template.code}` */ guildTemplate(guildId: Snowflake, code: string) { return `/guilds/${guildId}/templates/${code}` as const; },
/** * Route for: * - POST `/channels/{channel.id}/threads` * - POST `/channels/{channel.id}/messages/{message.id}/threads` */ threads(parentId: Snowflake, messageId?: Snowflake) { const parts = ['', 'channels', parentId];
if (messageId) parts.push('messages', messageId);
parts.push('threads');
return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`; },
/** * Route for: * - GET `/guilds/{guild.id}/threads/active` */ guildActiveThreads(guildId: Snowflake) { return `/guilds/${guildId}/threads/active` as const; },
/** * Route for: * - GET `/channels/{channel.id}/threads/archived/public` * - GET `/channels/{channel.id}/threads/archived/private` */ channelThreads(channelId: Snowflake, archivedStatus: 'public' | 'private') { return `/channels/${channelId}/threads/archived/${archivedStatus}` as const; },
/** * Route for: * - GET `/channels/{channel.id}/users/@me/threads/archived/prviate` */ channelJoinedArchivedThreads(channelId: Snowflake) { return `/channels/${channelId}/users/@me/threads/archived/private` as const; },
/** * Route for: * - GET `/channels/{thread.id}/thread-members` * - GET `/channels/{thread.id}/thread-members/{user.id}` * - PUT `/channels/{thread.id}/thread-members/@me` * - PUT `/channels/{thread.id}/thread-members/{user.id}` * - DELETE `/channels/{thread.id}/thread-members/@me` * - DELETE `/channels/{thread.id}/thread-members/{user.id}` */ threadMembers(threadId: Snowflake, userId?: Snowflake | '@me') { const parts = ['', 'channels', threadId, 'thread-members'];
if (userId) parts.push(userId);
return parts.join('/') as | `/channels/${Snowflake}/thread-members` | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`; },
/** * Route for: * - GET `/users/@me` * - GET `/users/{user.id}` * - PATCH `/users/@me` * * @param [userId='@me'] The user ID, defaulted to `@me` */ user(userId: Snowflake | '@me' = '@me') { return `/users/${userId}` as const; },
/** * Route for: * - GET `/users/@me/guilds` */ userGuilds() { return `/users/@me/guilds` as const; },
/** * Route for: * - GET `/users/@me/guilds/{guild.id}/member` */ userGuildMember(guildId: Snowflake) { return `/users/@me/guilds/${guildId}/member` as const; },
/** * Route for: * - DELETE `/users/@me/guilds/{guild.id}` */ userGuild(guildId: Snowflake) { return `/users/@me/guilds/${guildId}` as const; },
/** * Route for: * - POST `/users/@me/channels` */ userChannels() { return `/users/@me/channels` as const; },
/** * Route for: * - GET `/users/@me/connections` */ userConnections() { return `/users/@me/connections` as const; },
/** * Route for: * - GET `/voice/regions` */ voiceRegions() { return `/voice/regions` as const; },
/** * Route for: * - GET `/channels/{channel.id}/webhooks` * - POST `/channels/{channel.id}/webhooks` */ channelWebhooks(channelId: Snowflake) { return `/channels/${channelId}/webhooks` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/webhooks` */ guildWebhooks(guildId: Snowflake) { return `/guilds/${guildId}/webhooks` as const; },
/** * Route for: * - GET `/webhooks/{webhook.id}` * - GET `/webhooks/{webhook.id}/{webhook.token}` * - PATCH `/webhooks/{webhook.id}` * - PATCH `/webhooks/{webhook.id}/{webhook.token}` * - DELETE `/webhooks/{webhook.id}` * - DELETE `/webhooks/{webhook.id}/{webhook.token}` * - POST `/webhooks/{webhook.id}/{webhook.token}` * * - POST `/webhooks/{application.id}/{interaction.token}` */ webhook(webhookId: Snowflake, webhookToken?: string) { const parts = ['', 'webhooks', webhookId];
if (webhookToken) parts.push(webhookToken);
return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; },
/** * Route for: * - GET `/webhooks/{webhook.id}/{webhook.token}/messages/@original` * - GET `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}` * - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/@original` * - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}` * - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/@original` * - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}` * * - PATCH `/webhooks/{application.id}/{interaction.token}/messages/@original` * - PATCH `/webhooks/{application.id}/{interaction.token}/messages/{message.id}` * - DELETE `/webhooks/{application.id}/{interaction.token}/messages/{message.id}` * * @param [messageId='@original'] The message ID to change, defaulted to `@original` */ webhookMessage(webhookId: Snowflake, webhookToken: string, messageId: Snowflake | '@original' = '@original') { return `/webhooks/${webhookId}/${webhookToken}/messages/${messageId}` as const; },
/** * Route for: * - POST `/webhooks/{webhook.id}/{webhook.token}/github` * - POST `/webhooks/{webhook.id}/{webhook.token}/slack` */ webhookPlatform(webhookId: Snowflake, webhookToken: string, platform: 'github' | 'slack') { return `/webhooks/${webhookId}/${webhookToken}/${platform}` as const; },
/** * Route for: * - GET `/gateway` */ gateway() { return `/gateway` as const; },
/** * Route for: * - GET `/gateway/bot` */ gatewayBot() { return `/gateway/bot` as const; },
/** * Route for: * - GET `/oauth2/applications/@me` */ oauth2CurrentApplication() { return `/oauth2/applications/@me` as const; },
/** * Route for: * - GET `/oauth2/@me` */ oauth2CurrentAuthorization() { return `/oauth2/@me` as const; },
/** * Route for: * - GET `/oauth2/authorize` */ oauth2Authorization() { return `/oauth2/authorize` as const; },
/** * Route for: * - POST `/oauth2/token` */ oauth2TokenExchange() { return `/oauth2/token` as const; },
/** * Route for: * - POST `/oauth2/token/revoke` */ oauth2TokenRevocation() { return `/oauth2/token/revoke` as const; },
/** * Route for: * - GET `/applications/{application.id}/commands` * - PUT `/applications/{application.id}/commands` * - POST `/applications/{application.id}/commands` */ applicationCommands(applicationId: Snowflake) { return `/applications/${applicationId}/commands` as const; },
/** * Route for: * - GET `/applications/{application.id}/commands/{command.id}` * - PATCH `/applications/{application.id}/commands/{command.id}` * - DELETE `/applications/{application.id}/commands/{command.id}` */ applicationCommand(applicationId: Snowflake, commandId: Snowflake) { return `/applications/${applicationId}/commands/${commandId}` as const; },
/** * Route for: * - GET `/applications/{application.id}/guilds/{guild.id}/commands` * - PUT `/applications/{application.id}/guilds/{guild.id}/commands` * - POST `/applications/{application.id}/guilds/{guild.id}/commands` */ applicationGuildCommands(applicationId: Snowflake, guildId: Snowflake) { return `/applications/${applicationId}/guilds/${guildId}/commands` as const; },
/** * Route for: * - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}` * - PATCH `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}` * - DELETE `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}` */ applicationGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake) { return `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}` as const; },
/** * Route for: * - POST `/interactions/{interaction.id}/{interaction.token}/callback` */ interactionCallback(interactionId: Snowflake, interactionToken: string) { return `/interactions/${interactionId}/${interactionToken}/callback` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/member-verification` * - PATCH `/guilds/{guild.id}/member-verification` */ guildMemberVerification(guildId: Snowflake) { return `/guilds/${guildId}/member-verification` as const; },
/** * Route for: * - PATCH `/guilds/{guild.id}/voice-states/@me` * - PATCH `/guilds/{guild.id}/voice-states/{user.id}` */ guildVoiceState(guildId: Snowflake, userId: Snowflake | '@me' = '@me') { return `/guilds/${guildId}/voice-states/${userId}` as const; },
/** * Route for: * - GET `/applications/{application.id}/guilds/{guild.id}/commands/permissions` * - PUT `/applications/{application.id}/guilds/{guild.id}/commands/permissions` */ guildApplicationCommandsPermissions(applicationId: Snowflake, guildId: Snowflake) { return `/applications/${applicationId}/guilds/${guildId}/commands/permissions` as const; },
/** * Route for: * - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions` * - PUT `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions` */ applicationCommandPermissions(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake) { return `/applications/${applicationId}/guilds/${guildId}/commands/${commandId}/permissions` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/welcome-screen` * - PATCH `/guilds/{guild.id}/welcome-screen` */ guildWelcomeScreen(guildId: Snowflake) { return `/guilds/${guildId}/welcome-screen` as const; },
/** * Route for: * - POST `/stage-instances` */ stageInstances() { return `/stage-instances` as const; },
/** * Route for: * - GET `/stage-instances/{channel.id}` * - PATCH `/stage-instances/{channel.id}` * - DELETE `/stage-instances/{channel.id}` */ stageInstance(channelId: Snowflake) { return `/stage-instances/${channelId}` as const; },
/** * Route for: * - GET `/stickers/{sticker.id}` */ sticker(stickerId: Snowflake) { return `/stickers/${stickerId}` as const; },
/** * Route for: * - GET `/sticker-packs` */ nitroStickerPacks() { return '/sticker-packs' as const; },
/** * Route for: * - GET `/guilds/{guild.id}/stickers` * - POST `/guilds/{guild.id}/stickers` */ guildStickers(guildId: Snowflake) { return `/guilds/${guildId}/stickers` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/stickers/{sticker.id}` * - PATCH `/guilds/{guild.id}/stickers/{sticker.id}` * - DELETE `/guilds/{guild.id}/stickers/{sticker.id}` */ guildSticker(guildId: Snowflake, stickerId: Snowflake) { return `/guilds/${guildId}/stickers/${stickerId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/scheduled-events` * - POST `/guilds/{guild.id}/scheduled-events` */ guildScheduledEvents(guildId: Snowflake) { return `/guilds/${guildId}/scheduled-events` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}` * - PATCH `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}` * - DELETE `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}` */ guildScheduledEvent(guildId: Snowflake, guildScheduledEventId: Snowflake) { return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}/users` */ guildScheduledEventUsers(guildId: Snowflake, guildScheduledEventId: Snowflake) { return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users` as const; },};
export const StickerPackApplicationId = '710982414301790216';
export const CDNRoutes = { /** * Route for: * - GET `/emojis/{emoji.id}.{png|jpeg|webp|gif}` * * As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format * * This route supports the extensions: PNG, JPEG, WebP, GIF */ emoji(emojiId: Snowflake, format: EmojiFormat) { return `/emojis/${emojiId}.${format}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}` * * As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format * * This route supports the extensions: PNG, JPEG, WebP, GIF */ guildIcon(guildId: Snowflake, guildIcon: string, format: GuildIconFormat) { return `icons/${guildId}/${guildIcon}.${format}` as const; },
/** * Route for: * - GET `/splashes/{guild.id}/{guild.splash}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ guildSplash(guildId: Snowflake, guildSplash: string, format: GuildSplashFormat) { return `/splashes/${guildId}/${guildSplash}.${format}` as const; },
/** * Route for: * - GET `/discovery-splashes/{guild.id}/{guild.discovery_splash}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ guildDiscoverySplash(guildId: Snowflake, guildDiscoverySplash: string, format: GuildDiscoverySplashFormat) { return `/discovery-splashes/${guildId}/${guildDiscoverySplash}.${format}` as const; },
/** * Route for: * - GET `/banners/{guild.id}/{guild.banner}.{png|jpeg|webp|gif}` * * As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format * * This route supports the extensions: PNG, JPEG, WebP, GIF */ guildBanner(guildId: Snowflake, guildBanner: string, format: GuildBannerFormat) { return `/banners/${guildId}/${guildBanner}.${format}` as const; },
/** * Route for: * - GET `/banners/{user.id}/{user.banner}.{png|jpeg|webp|gif}` * * As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format * * This route supports the extensions: PNG, JPEG, WebP, GIF */ userBanner(userId: Snowflake, userBanner: string, format: UserBannerFormat) { return `/banners/${userId}/${userBanner}.${format}` as const; },
/** * Route for: * - GET `/embed/avatars/{user.discriminator % 5}.png` * * The `userDiscriminator` parameter should be the user discriminator modulo 5 (e.g. 1337 % 5 = 2) * * This route supports the extension: PNG */ defaultUserAvatar(userDiscriminator: DefaultUserAvatarAssets) { return `/embed/avatars/${userDiscriminator}.png` as const; },
/** * Route for: * - GET `/avatars/{user.id}/{user.avatar}.{png|jpeg|webp|gif}` * * As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format * * This route supports the extensions: PNG, JPEG, WebP, GIF */ userAvatar(userId: Snowflake, userAvatar: string, format: UserAvatarFormat) { return `/avatars/${userId}/${userAvatar}.${format}` as const; },
/** * Route for: * - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}` * * As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format * * This route supports the extensions: PNG, JPEG, WebP, GIF */ guildMemberAvatar(guildId: Snowflake, userId: Snowflake, memberAvatar: string, format: GuildMemberAvatarFormat) { return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const; },
/** * Route for: * - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ applicationIcon(applicationId: Snowflake, applicationIcon: string, format: ApplicationIconFormat) { return `/app-icons/${applicationId}/${applicationIcon}.${format}` as const; },
/** * Route for: * - GET `/app-icons/{application.id}/{application.cover_image}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ applicationCover(applicationId: Snowflake, applicationCoverImage: string, format: ApplicationCoverFormat) { return `/app-icons/${applicationId}/${applicationCoverImage}.${format}` as const; },
/** * Route for: * - GET `/app-icons/{application.id}/{application.asset_id}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ applicationAsset(applicationId: Snowflake, applicationAssetId: string, format: ApplicationAssetFormat) { return `/app-icons/${applicationId}/${applicationAssetId}.${format}` as const; },
/** * Route for: * - GET `/app-assets/{application.id}/achievements/{achievement.id}/icons/{achievement.icon}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ achievementIcon( applicationId: Snowflake, achievementId: Snowflake, achievementIconHash: string, format: AchievementIconFormat, ) { return `/app-assets/${applicationId}/achievements/${achievementId}/icons/${achievementIconHash}.${format}` as const; },
/** * Route for: * - GET `/app-assets/710982414301790216/store/{sticker_pack.banner.asset_id}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ stickerPackBanner(stickerPackBannerAssetId: Snowflake, format: StickerPackBannerFormat) { return `/app-assets/${StickerPackApplicationId}/store/${stickerPackBannerAssetId}.${format}` as const; },
/** * Route for: * - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ teamIcon(teamId: Snowflake, teamIcon: string, format: TeamIconFormat) { return `/team-icons/${teamId}/${teamIcon}.${format}` as const; },
/** * Route for: * - GET `/stickers/{sticker.id}.{png|json}` * * This route supports the extensions: PNG, Lottie */ sticker(stickerId: Snowflake, format: StickerFormat) { return `/stickers/${stickerId}.${format}` as const; },
/** * Route for: * - GET `/role-icons/{role.id}/{role.icon}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ roleIcon(roleId: Snowflake, roleIcon: string, format: RoleIconFormat) { return `/role-icons/${roleId}/${roleIcon}.${format}` as const; },
/** * Route for: * - GET `/guild-events/{guild_scheduled_event.id}/{guild_scheduled_event.image}.{png|jpeg|webp}` * * This route supports the extensions: PNG, JPEG, WebP */ guildScheduledEventCover( guildScheduledEventId: Snowflake, guildScheduledEventCoverImage: string, format: GuildScheduledEventCoverFormat, ) { return `/guild-events/${guildScheduledEventId}/${guildScheduledEventCoverImage}.${format}` as const; },
/** * Route for: * - GET `/guilds/${guild.id}/users/${user.id}/banners/${guild_member.banner}.{png|jpeg|webp|gif}` * * This route supports the extensions: PNG, JPEG, WebP, GIF */ guildMemberBanner(guildId: Snowflake, userId: Snowflake, guildMemberBanner: string, format: GuildMemberBannerFormat) { return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const; },};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type GuildBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;export type UserBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;export type DefaultUserAvatar = Extract<ImageFormat, ImageFormat.PNG>;export type UserAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;export type GuildMemberAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie>;export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export enum ImageFormat { JPEG = 'jpeg', PNG = 'png', WebP = 'webp', GIF = 'gif', Lottie = 'json',}
export interface CDNQuery { /** * The returned image can have the size changed by using this query parameter * * Image size can be any power of two between 16 and 4096 */ size?: number;}
export const RouteBases = { api: `https://discord.com/api/v${APIVersion}`, cdn: 'https://cdn.discordapp.com', invite: 'https://discord.gg', template: 'https://discord.new', gift: 'https://discord.gift', scheduledEvent: 'https://discord.com/events',} as const;
// Freeze bases objectObject.freeze(RouteBases);
export const OAuth2Routes = { authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`, tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`, /** * See https://tools.ietf.org/html/rfc7009 */ tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,} as const;
// Freeze OAuth2 route objectObject.freeze(OAuth2Routes);