GramIO API Reference / @gramio/contexts/dist / InlineQueryContext
Class: InlineQueryContext<Bot>
Defined in: contexts/index.d.ts:6058
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
Extends
Context<Bot>.Constructor<InlineQueryContext<Bot>>.InlineQuery.CloneMixin<Bot,InlineQueryContext<Bot>,InlineQueryContextOptions<Bot>>
Type Parameters
| Type Parameter |
|---|
Bot extends BotLike |
Constructors
Constructor
new InlineQueryContext<
Bot>(options):InlineQueryContext<Bot>
Defined in: contexts/index.d.ts:6061
Parameters
| Parameter | Type |
|---|---|
options | InlineQueryContextOptions<Bot> |
Returns
InlineQueryContext<Bot>
Overrides
Constructor
new InlineQueryContext(...
args):InlineQueryContext
Defined in: contexts/index.d.ts:6058
Parameters
| Parameter | Type |
|---|---|
...args | any[] |
Returns
InlineQueryContext
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 | TelegramInlineQuery | The raw data that is used for this Context | InlineQuery.payload | contexts/index.d.ts:6060 |
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
from
Get Signature
get from():
User
Defined in: contexts/index.d.ts:4119
Sender
Returns
Inherited from
id
Get Signature
get id():
string
Defined in: contexts/index.d.ts:4117
Unique identifier for this query
Returns
string
Inherited from
location
Get Signature
get location():
Location
Defined in: contexts/index.d.ts:4121
Sender location, only for bots that request user location
Returns
Inherited from
offset
Get Signature
get offset():
string
Defined in: contexts/index.d.ts:4125
Offset of the results to be returned, can be controlled by the bot
Returns
string
Inherited from
query
Get Signature
get query():
string
Defined in: contexts/index.d.ts:4123
Text of the query (up to 256 characters)
Returns
string
Inherited from
senderId
Get Signature
get senderId():
number
Defined in: contexts/index.d.ts:6063
Sender's ID
Returns
number
Methods
answer()
answer(
results,params?):Promise<true>
Defined in: contexts/index.d.ts:6069
Answers to inline query. An alias for answerInlineQuery
Parameters
| Parameter | Type |
|---|---|
results | TelegramInlineQueryResult[] |
params? | Partial<AnswerInlineQueryParams> |
Returns
Promise<true>
answerInlineQuery()
answerInlineQuery(
results,params?):Promise<true>
Defined in: contexts/index.d.ts:6067
Answers to inline query
Parameters
| Parameter | Type |
|---|---|
results | TelegramInlineQueryResult[] |
params? | Partial<AnswerInlineQueryParams> |
Returns
Promise<true>
clone()
clone(
options?):InlineQueryContext
Defined in: contexts/index.d.ts:5407
Parameters
| Parameter | Type |
|---|---|
options? | InlineQueryContextOptions |
Returns
InlineQueryContext
Inherited from
hasLocation()
hasLocation():
this is Require<InlineQueryContext<Bot>, "location">
Defined in: contexts/index.d.ts:6065
Checks if query has location property
Returns
this is Require<InlineQueryContext<Bot>, "location">
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] : {})