Skip to content

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

Class: ManagedBotContext<Bot>

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

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:6143

Parameters

ParameterType
optionsManagedBotContextOptions<Bot>

Returns

ManagedBotContext<Bot>

Overrides

Context.constructor


Constructor

new ManagedBotContext(...args): ManagedBotContext

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

Parameters

ParameterType
...argsany[]

Returns

ManagedBotContext

Overrides

Context<Bot>.constructor

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
botpublicBot-Context.botcontexts/index.d.ts:4856
payloadpublicTelegramManagedBotUpdatedThe raw data that is used for this ContextCloneMixin.payloadcontexts/index.d.ts:6142
update?publicTelegramUpdate-Context.updatecontexts/index.d.ts:4858
updateId?publicnumber-Context.updateIdcontexts/index.d.ts:4857
updateTypeprotectedUpdateName-Context.updateTypecontexts/index.d.ts:4859

Accessors

[toStringTag]

Get Signature

get [toStringTag](): string

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

MDN

Returns

string

Inherited from

Context.[toStringTag]


managedBot

Get Signature

get managedBot(): User

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

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:6145

User that created the bot

Returns

User

Methods

clone()

clone(options?): ManagedBotContext

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

Parameters

ParameterType
options?ManagedBotContextOptions

Returns

ManagedBotContext

Inherited from

CloneMixin.clone


getManagedBotToken()

getManagedBotToken(params?): Promise<string>

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

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:4865

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:6153

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>