Skip to content

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

Class: ManagedBotContext<Bot> ​

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

This object represents a new bot created to be managed by the current bot, or a bot whose token was changed.

Extends ​

Type Parameters ​

Type Parameter
Bot extends BotLike

Constructors ​

Constructor ​

new ManagedBotContext<Bot>(options): ManagedBotContext<Bot>

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

Parameters ​

ParameterType
optionsManagedBotContextOptions<Bot>

Returns ​

ManagedBotContext<Bot>

Overrides ​

Context.constructor


Constructor ​

new ManagedBotContext(...args): ManagedBotContext

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

Parameters ​

ParameterType
...argsany[]

Returns ​

ManagedBotContext

Overrides ​

Context<Bot>.constructor

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
botpublicBot-Context.botcontexts/index.d.ts:5240
payloadpublicTelegramManagedBotUpdatedThe raw data that is used for this ContextCloneMixin.payloadcontexts/index.d.ts:6765
update?publicTelegramUpdate-Context.updatecontexts/index.d.ts:5242
updateId?publicnumber-Context.updateIdcontexts/index.d.ts:5241
updateTypeprotectedUpdateName-Context.updateTypecontexts/index.d.ts:5243

Accessors ​

[toStringTag] ​

Get Signature ​

get [toStringTag](): string

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

MDN

Returns ​

string

Inherited from ​

Context.[toStringTag]


managedBot ​

Get Signature ​

get managedBot(): User

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

Information about the bot. Token of the bot can be fetched using the method getManagedBotToken.

Returns ​

User


user ​

Get Signature ​

get user(): User

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

User that created the bot

Returns ​

User

Methods ​

clone() ​

clone(options?): ManagedBotContext

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

Parameters ​

ParameterType
options?ManagedBotContextOptions

Returns ​

ManagedBotContext

Inherited from ​

CloneMixin.clone


getManagedBotToken() ​

getManagedBotToken(params?): Promise<string>

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

Returns the token of the managed bot created by this user

Parameters ​

ParameterType
params?Optional<GetManagedBotTokenParams, "user_id">

Returns ​

Promise<string>


is() ​

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

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

Type Parameters ​

Type Parameter
T extends UpdateName

Parameters ​

ParameterType
rawTypesMaybeArray<SoftString<T>>

Returns ​

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

Inherited from ​

Context.is


replaceManagedBotToken() ​

replaceManagedBotToken(params?): Promise<string>

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

Revokes the current token of the managed bot created by this user and generates a new one

Parameters ​

ParameterType
params?Optional<ReplaceManagedBotTokenParams, "user_id">

Returns ​

Promise<string>