Skip to content

GramIO API Reference / @gramio/contexts/dist / DownloadMixin

Class: DownloadMixin<Bot>

Defined in: contexts/index.d.ts:5282

This object represents a mixin that can be used to download media files

Extends

Extended by

Type Parameters

Type Parameter
Bot extends BotLike

Constructors

Constructor

new DownloadMixin<Bot>(): DownloadMixin<Bot>

Returns

DownloadMixin<Bot>

Inherited from

Context.constructor

Properties

PropertyModifierTypeInherited fromDefined in
botpublicBotContext.botcontexts/index.d.ts:4726
update?publicTelegramUpdateContext.updatecontexts/index.d.ts:4728
updateId?publicnumberContext.updateIdcontexts/index.d.ts:4727
updateTypeprotectedUpdateNameContext.updateTypecontexts/index.d.ts:4729

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

Defined in: contexts/index.d.ts:4732

MDN

Returns

string

Inherited from

Context.[toStringTag]


attachment

Get Signature

get attachment(): Attachment

Defined in: contexts/index.d.ts:5279

Returns

Attachment

Methods

download()

Call Signature

download(): Promise<ArrayBuffer>

Defined in: contexts/index.d.ts:5284

Downloads attachment

Returns

Promise<ArrayBuffer>

Call Signature

download(path): Promise<string>

Defined in: contexts/index.d.ts:5285

Downloads attachment

Parameters
ParameterType
pathstring
Returns

Promise<string>


is()

is<T>(rawTypes): this is InstanceType<ContextsMapping<Bot>[T]> & Bot["__Derives"]["global"] & Bot["__Derives"][T] & (Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})

Defined in: contexts/index.d.ts:4735

Type Parameters

Type Parameter
T extends UpdateName

Parameters

ParameterType
rawTypesMaybeArray<SoftString<T>>

Returns

this is InstanceType<ContextsMapping<Bot>[T]> & Bot["__Derives"]["global"] & Bot["__Derives"][T] & (Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})

Inherited from

Context.is