Skip to content

export Class

InvoicesManager ​

extends ​

CachedManager<string, Invoice>

Constructor ​

ts
 new InvoicesManager( client )
ParameterTypeDescription
clientClient

Properties ​

get cache : Collection<CachedManager.K, CachedManager.V> ​

get defaults : Function ​

get isJson : Function ​

get nest : Function ​

readonly client : Client ​

readonly default? : any ​

readonly options : any ​

provider_token? : string ​

The token provided by your payment provider for payments.

Methods ​

_add( data, cache, param2 ) ​

ParameterTypeDescription
dataanyThe data to add to the cache manager.
cache = truebooleanPass True to cache the data.
param2 = {}anyAdditional data to pass.

Add data with cache check to the current manager.

Returns: any

create( id, invoice ) ​

ParameterTypeDescription
idstringThe id of the invoices to store as.
invoiceInvoiceThe payload of the invoice.

Creates an invoice and store it in the manger.

Returns: any

ParameterTypeDescription
idstringThe id of the invoices to store as.
payloadCreateInvoiceLinkPayloadThe payload of the invoice link.

Creates an invoice link and store it in the manager.

Returns: Promise<string | boolean>

generate( id ) ​

ParameterTypeDescription
idstringThe id of the invoice.

Returns an invoice link, invoice or false if the invoice is not found.

Returns: false | String | Partial<Invoice>

asyncsend( id, chat_id ) ​

ParameterTypeDescription
idstringThe id of the invoice.
chat_idnumberThe target chat to send the invoice to.

This will only work with invoices and not link invoices!

Returns: Promise<null | Message>

setToken( token ) ​

ParameterTypeDescription
tokenstringThe token provided by your payment provider for payments.

Sets the token for the invoices generated.

Returns: void

A modern, powerful library for building your Telegram bots, with seamless support for both JavaScript and Typescript.