convertKey()
function src/structures/basestructure.ts:16function convertKey(snake: string): stringimport { Structures } from 'detritus-client';Classes you create or receive from the library.
Object shapes for options, payloads and events.
Standalone helpers.
function convertKey(snake: string): stringfunction createChannelFromData(
client: ShardClient,
data?: BaseStructureData,
isClone?: boolean,
): Channelfunction messageSystemContent(message: Message, text?: string): stringfunction setStructureUncloneable(structure: Function): voidNamed types used across the API.
type Channel = ChannelBase | ChannelDM | ChannelGuildVoice | ChannelDMGroup | ChannelGuildTypetype ChannelGuildType = ChannelGuildBase | ChannelGuildCategory | ChannelGuildText | ChannelGuildVoice | ChannelGuildStore | ChannelGuildThread | ChannelGuildStageVoice | ChannelGuildDirectory | ChannelGuildForumtype ChannelTextType = ChannelDM | ChannelDMGroup | ChannelGuildText | ChannelGuildThreadtype ComponentLabelChild = ComponentCheckbox | ComponentCheckboxGroup | ComponentFileUpload | ComponentInputText | ComponentRadioGroup | ComponentSelectMenu | ComponentUnknowntype ComponentsTopLevel = ComponentActionRow | ComponentContainer | ComponentFile | ComponentMediaGallery | ComponentSection | ComponentSeparator | ComponentTextDisplay | ComponentUnknowntype InteractionDataModalComponent = ComponentActionRow | ComponentLabel | ComponentTextDisplay | ComponentUnknowntype InteractionEditOrRespond = RequestTypes.CreateInteractionResponseInnerPayload & RequestTypes.EditWebhookTokenMessagetype InteractionResponseData = RequestTypes.CreateInteractionResponseInnerPayload | InteractionModal | stringtype InteractionResponseOptions = RequestTypes.CreateInteractionResponse | InteractionModal | numberPass an InteractionModal itself (not its json) as either argument to respond with it, so its run gets called when it's submitted e.g. respond(modal) or respond(InteractionCallbackTypes.MODAL, modal)
type StructureKeysName = "_keys" | "_keysMerge" | "_keysSkipDifference"Exported values.
const EmbeddableRegexes: Readonly<{ audio: RegExp; image: RegExp; video: RegExp }>export const EmbeddableRegexes = Object.freeze({
audio: /^(?:mp3|ogg|wav|flac)$/i,
image: /^(?:png|jpe?g|webp|gif)$/i,
video: /^(?:mp4|webm|mov)$/i,
});const ImageSizes: Readonly<{ LARGE: 160; SMALL: 64 }>export const ImageSizes = Object.freeze({
SMALL: 64,
LARGE: 160,
});const keysStoreApplicationAsset: BaseSet<string>export const keysStoreApplicationAsset = new BaseSet<string>([
DiscordKeys.APPLICATION_ID,
DiscordKeys.FILENAME,
DiscordKeys.HEIGHT,
DiscordKeys.ID,
DiscordKeys.MIME_TYPE,
DiscordKeys.SIZE,
DiscordKeys.WIDTH,
]);const MimeClassTypes: { classType: string; regex: RegExp; type: string }[]export const MimeClassTypes: Array<{
classType: string,
regex: RegExp,
type: string,
}> = [
{
type: 'name',
classType: 'acrobat',
regex: /\.pdf$/i,
},
{
type: 'name',
classType: 'ae',
regex: /\.ae/i,
},
{
type: 'name',
classType: 'ai',
regex: /\.ai$/i,
},
{
type: 'name',
classType: 'archive',
regex: /\.(?:rar|zip|7z|tar|tar\.gz)$/i,
},
{
type: 'name',
classType: 'audio',
regex: /\.(?:mp3|ogg|wav|flac)$/i,
},
{
type: 'name',
classType: 'code',
regex: /\.(?:c\+\+|cpp|cc|c|h|hpp|mm|m|json|js|rb|rake|py|asm|fs|pyc|dtd|cgi|bat|rss|java|graphml|idb|lua|o|gml|prl|sls|conf|cmake|make|sln|vbe|cxx|wbf|vbs|r|wml|php|bash|applescript|fcgi|yaml|ex|exs|sh|ml|actionscript)$/i,
},
{
type: 'name',
classType: 'document',
regex: /\.(?:txt|rtf|doc|docx|md|pages|ppt|pptx|pptm|key|log)$/i,
},
{
// before `image` since it's an `image/` mimetype too
type: 'mime',
classType: 'photoshop',
regex: /^image\/vnd.adobe.photoshop/,
},
{
type: 'mime',
classType: 'image',
regex: /^image\//,
},
{
type: 'name',
classType: 'sketch',
regex: /\.sketch$/i,
},
{
type: 'name',
classType: 'spreadsheet',
regex: /\.(?:xls|xlsx|numbers|csv)$/i,
},
{
type: 'mime',
classType: 'video',
regex: /^video\//,
},
{
type: 'name',
classType: 'webcode',
regex: /\.(?:html|xhtml|htm|js|xml|xls|xsd|css|styl)$/i,
},
];const SpecialApplications: Readonly<{ XBOX: "438122941302046720" }>export const SpecialApplications = Object.freeze({
XBOX: '438122941302046720',
});const SpecialPrefixes: Readonly<{ SPOTIFY: "spotify:" }>export const SpecialPrefixes = Object.freeze({
SPOTIFY: 'spotify:',
});const SpecialThirdPartySkus: { [key: string]: string }export const SpecialThirdPartySkus: {[key: string]: string} = Object.freeze({
'Call of Duty Black Ops 4': 'call-of-duty',
'Call of Duty Modern Warfare': 'call-of-duty-mw',
'StarCraft': 'starcraft-remastered',
'World of Warcraft Classic': 'world-of-warcraft',
'World of Warcraft Public Test': 'world-of-warcraft',
});