Skip to content

DataResolver

classe · Source

The DataResolver identifies different objects and tries to resolve a specific piece of information from them.

Methods

resolveCode

static

resolveCode(data: string, regex: RegExp): string

Resolves the string to a code based on the passed regex. Parameters

NameTypeDescription
datastringThe string to resolve
regexRegExpThe RegExp used to extract the code

Returns: stringSource

resolveInviteCode

static

resolveInviteCode(data: InviteResolvable): string

Resolves InviteResolvable to an invite code. Parameters

NameTypeDescription
dataInviteResolvableThe invite resolvable to resolve

Returns: stringSource

resolveGuildTemplateCode

static

resolveGuildTemplateCode(data: GuildTemplateResolvable): string

Resolves GuildTemplateResolvable to a template code. Parameters

NameTypeDescription
dataGuildTemplateResolvableThe template resolvable to resolve

Returns: stringSource

resolveImage

static · async

async resolveImage(image: BufferResolvable | Base64Resolvable): Promise<?string>

Resolves a Base64Resolvable, a string, or a BufferResolvable to a Base 64 image. Parameters

NameTypeDescription
imageBufferResolvable | Base64ResolvableThe image to be resolved

Returns: Promise<?string>Source

resolveBase64

static

resolveBase64(data: Base64Resolvable): string

Resolves a Base64Resolvable to a Base 64 image. Parameters

NameTypeDescription
dataBase64ResolvableThe base 64 resolvable you want to resolve

Returns: stringSource

resolveFile

static · async

async resolveFile(resource: BufferResolvable | Stream): Promise<(Buffer|Stream)>

Resolves a BufferResolvable to a Buffer or a Stream. Parameters

NameTypeDescription
resourceBufferResolvable | StreamThe buffer or stream resolvable to resolve

Returns: Promise<(Buffer\|Stream)>Source

resolveFileAsBuffer

static · async

async resolveFileAsBuffer(resource: BufferResolvable | Stream): Promise<Buffer>

Resolves a BufferResolvable to a Buffer. Parameters

NameTypeDescription
resourceBufferResolvable | StreamThe buffer or stream resolvable to resolve

Returns: Promise<Buffer>Source

Unofficial software. Not affiliated with or supported by Discord.