telegram-bot-api-nodejs
Advanced tools
Comparing version 1.0.18 to 1.0.19
@@ -49,3 +49,9 @@ export type ChatType = "private" | "group" | "supergroup" | "channel"; | ||
commands: BotCommand[]; | ||
scope: BotCommandScope; | ||
language_code: string | undefined; | ||
} | ||
interface GetMyCommandsOptions { | ||
scope?: BotCommandScope; | ||
language_code?: string; | ||
} | ||
interface DeleteMyCommandsOptions { | ||
@@ -590,2 +596,28 @@ } | ||
} | ||
type BotCommandScope = BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember; | ||
interface BotCommandScopeDefault { | ||
type: 'default'; | ||
} | ||
interface BotCommandScopeAllPrivateChats { | ||
type: 'all_private_chats'; | ||
} | ||
interface BotCommandScopeAllGroupChats { | ||
type: 'all_group_chats'; | ||
} | ||
interface BotCommandScopeAllChatAdministrators { | ||
type: 'all_chat_administrators'; | ||
} | ||
interface BotCommandScopeChat { | ||
type: 'chat'; | ||
chat_id: number | string; | ||
} | ||
interface BotCommandScopeChatAdministrators { | ||
type: 'chat_administrators'; | ||
chat_id: number | string; | ||
} | ||
interface BotCommandScopeChatMember { | ||
type: 'chat_member'; | ||
chat_id: number | string; | ||
user_id: number; | ||
} | ||
export declare function setWebhook(token: string, body: SetWebHookOptions, signal: AbortSignal): Promise<Boolean>; | ||
@@ -645,3 +677,4 @@ export declare function deleteWebhook(token: string, params: { | ||
}, signal?: AbortSignal): Promise<ChatMember>; | ||
export declare function setMyCommands(token: string, payload: SetMyCommandsOptions, signal?: AbortSignal): Promise<Chat>; | ||
export declare function setMyCommands(token: string, payload: SetMyCommandsOptions, signal?: AbortSignal): Promise<void>; | ||
export declare function getMyCommands(token: string, payload?: GetMyCommandsOptions, signal?: AbortSignal): Promise<BotCommand[]>; | ||
export declare function deleteMyCommands(token: string, payload: DeleteMyCommandsOptions, signal: AbortSignal): Promise<Chat>; | ||
@@ -648,0 +681,0 @@ /** |
@@ -169,2 +169,10 @@ /** | ||
} | ||
export function getMyCommands(token, payload, signal) { | ||
return fetch(`https://api.telegram.org/bot${token}/getMyCommands`, { | ||
method: "POST", | ||
body: JSON.stringify(payload), | ||
headers, | ||
signal | ||
}).then((parseResponse)); | ||
} | ||
export function deleteMyCommands(token, payload, signal) { | ||
@@ -171,0 +179,0 @@ return fetch(`https://api.telegram.org/bot${token}/deleteMyCommands`, { |
{ | ||
"name": "telegram-bot-api-nodejs", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"description": "Telegram Bot API client for nodejs", | ||
@@ -5,0 +5,0 @@ "type": "module", |
39429
1259
19