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
Context<Bot>.Constructor<ManagedBotContext<Bot>>.CloneMixin<Bot,ManagedBotContext<Bot>,ManagedBotContextOptions<Bot>>
Type Parameters
| Type Parameter |
|---|
Bot extends BotLike |
Constructors
Constructor
new ManagedBotContext<
Bot>(options):ManagedBotContext<Bot>
Defined in: contexts/index.d.ts:6143
Parameters
| Parameter | Type |
|---|---|
options | ManagedBotContextOptions<Bot> |
Returns
ManagedBotContext<Bot>
Overrides
Constructor
new ManagedBotContext(...
args):ManagedBotContext
Defined in: contexts/index.d.ts:6140
Parameters
| Parameter | Type |
|---|---|
...args | any[] |
Returns
ManagedBotContext
Overrides
Context<Bot>.constructor
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
bot | public | Bot | - | Context.bot | contexts/index.d.ts:4856 |
payload | public | TelegramManagedBotUpdated | The raw data that is used for this Context | CloneMixin.payload | contexts/index.d.ts:6142 |
update? | public | TelegramUpdate | - | Context.update | contexts/index.d.ts:4858 |
updateId? | public | number | - | Context.updateId | contexts/index.d.ts:4857 |
updateType | protected | UpdateName | - | Context.updateType | contexts/index.d.ts:4859 |
Accessors
[toStringTag]
Get Signature
get [toStringTag]():
string
Defined in: contexts/index.d.ts:4862
Returns
string
Inherited from
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
Get Signature
get user():
User
Defined in: contexts/index.d.ts:6145
User that created the bot
Returns
Methods
clone()
clone(
options?):ManagedBotContext
Defined in: contexts/index.d.ts:5407
Parameters
| Parameter | Type |
|---|---|
options? | ManagedBotContextOptions |
Returns
ManagedBotContext
Inherited from
getManagedBotToken()
getManagedBotToken(
params?):Promise<string>
Defined in: contexts/index.d.ts:6151
Returns the token of the managed bot created by this user
Parameters
| Parameter | Type |
|---|---|
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
| Parameter | Type |
|---|---|
rawTypes | MaybeArray<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
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
| Parameter | Type |
|---|---|
params? | Optional<ReplaceManagedBotTokenParams, "user_id"> |
Returns
Promise<string>