Skip to content

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

Class: AudioAttachment ​

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

This object represents an audio file to be treated as music by the Telegram clients.

Extends ​

Constructors ​

Constructor ​

new AudioAttachment(payload): AudioAttachment

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

Parameters ​

ParameterType
payloadTelegramAudio

Returns ​

AudioAttachment

Inherited from ​

FileAttachment.constructor

Properties ​

PropertyModifierTypeDescriptionOverridesInherited fromDefined in
attachmentTypepublicAttachmentTypeReturns attachment's type (e.g. 'audio', 'photo')FileAttachment.attachmentType-contexts/index.d.ts:462
payloadprotectedTelegramAudio--FileAttachment.payloadcontexts/index.d.ts:422

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string

Inherited from ​

FileAttachment.[toStringTag]


duration ​

Get Signature ​

get duration(): number

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

Duration of the audio in seconds as defined by sender

Returns ​

number


fileId ​

Get Signature ​

get fileId(): string

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

Identifier for this file, which can be used to download or reuse the file

Returns ​

string

Inherited from ​

FileAttachment.fileId


fileName ​

Get Signature ​

get fileName(): string

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

Original filename as defined by sender

Returns ​

string


fileSize ​

Get Signature ​

get fileSize(): number

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

File size

Returns ​

number


fileUniqueId ​

Get Signature ​

get fileUniqueId(): string

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

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

Returns ​

string

Inherited from ​

FileAttachment.fileUniqueId


mimeType ​

Get Signature ​

get mimeType(): string

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

MIME type of the file as defined by sender

Returns ​

string


performer ​

Get Signature ​

get performer(): string

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

Performer of the audio as defined by sender or by audio tags

Returns ​

string


thumbnail ​

Get Signature ​

get thumbnail(): PhotoSize

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

Thumbnail of the album cover to which the music file belongs

Returns ​

PhotoSize


title ​

Get Signature ​

get title(): string

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

Title of the audio as defined by sender or by audio tags

Returns ​

string