mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-22 18:07:16 +00:00
feat: Bot API v8.3
This commit is contained in:
parent
b4effe6980
commit
0b2662fd24
@ -18,6 +18,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
* getAvailableGifts (@danielperez9430)
|
* getAvailableGifts (@danielperez9430)
|
||||||
* sendGift (@danielperez9430)
|
* sendGift (@danielperez9430)
|
||||||
|
|
||||||
|
4. Support Telegram Bot API 8.2 and 8.3 (@danielperez9430)
|
||||||
|
* verifyUser
|
||||||
|
* verifyChat
|
||||||
|
* removeUserVerification
|
||||||
|
* removeChatVerification
|
||||||
|
|
||||||
## [0.67.0][0.67.0] - 2024-05-30
|
## [0.67.0][0.67.0] - 2024-05-30
|
||||||
|
|
||||||
1. Support Telegram Bot API 7.4 (@danielperez9430)
|
1. Support Telegram Bot API 7.4 (@danielperez9430)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).
|
Node.js module to interact with the official [Telegram Bot API](https://core.telegram.org/bots/api).
|
||||||
|
|
||||||
|
|
||||||
[](https://core.telegram.org/bots/api)
|
[](https://core.telegram.org/bots/api)
|
||||||
[](https://www.npmjs.org/package/node-telegram-bot-api)
|
[](https://www.npmjs.org/package/node-telegram-bot-api)
|
||||||
[](https://codecov.io/gh/yagop/node-telegram-bot-api)
|
[](https://codecov.io/gh/yagop/node-telegram-bot-api)
|
||||||
|
|
||||||
|
56
doc/api.md
56
doc/api.md
@ -161,6 +161,10 @@ TelegramBot
|
|||||||
* [.deleteMessages(chatId, messageIds, [options])](#TelegramBot+deleteMessages) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
* [.deleteMessages(chatId, messageIds, [options])](#TelegramBot+deleteMessages) ⇒ <code>[ 'Promise' ].<Boolean></code>
|
||||||
* [.getAvailableGifts([options])](#TelegramBot+getAvailableGifts) ⇒ <code>Promise</code>
|
* [.getAvailableGifts([options])](#TelegramBot+getAvailableGifts) ⇒ <code>Promise</code>
|
||||||
* [.sendGift(giftId, [options])](#TelegramBot+sendGift) ⇒ <code>Promise</code>
|
* [.sendGift(giftId, [options])](#TelegramBot+sendGift) ⇒ <code>Promise</code>
|
||||||
|
* [.verifyUser(userId)](#TelegramBot+verifyUser) ⇒ <code>Promise</code>
|
||||||
|
* [.verifyChat(chatId)](#TelegramBot+verifyChat) ⇒ <code>Promise</code>
|
||||||
|
* [.removeUserVerification(userId)](#TelegramBot+removeUserVerification) ⇒ <code>Promise</code>
|
||||||
|
* [.removeChatVerification(chatId)](#TelegramBot+removeChatVerification) ⇒ <code>Promise</code>
|
||||||
* _static_
|
* _static_
|
||||||
* [.errors](#TelegramBot.errors) : <code>Object</code>
|
* [.errors](#TelegramBot.errors) : <code>Object</code>
|
||||||
* [.messageTypes](#TelegramBot.messageTypes) : <code>[ 'Array' ].<String></code>
|
* [.messageTypes](#TelegramBot.messageTypes) : <code>[ 'Array' ].<String></code>
|
||||||
@ -2609,6 +2613,58 @@ Use this method to sends a gift to the given user or channel chat.
|
|||||||
| giftId | <code>String</code> | Unique identifier of the gift |
|
| giftId | <code>String</code> | Unique identifier of the gift |
|
||||||
| [options] | <code>Object</code> | Additional Telegram query options |
|
| [options] | <code>Object</code> | Additional Telegram query options |
|
||||||
|
|
||||||
|
<a name="TelegramBot+verifyUser"></a>
|
||||||
|
|
||||||
|
### telegramBot.verifyUser(userId) ⇒ <code>Promise</code>
|
||||||
|
This method verifies a user [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||||
|
**Returns**: <code>Promise</code> - On success, returns true.
|
||||||
|
**See**: https://core.telegram.org/bots/api#verifyuser
|
||||||
|
|
||||||
|
| Param | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| userId | <code>Number</code> | Unique identifier of the target user |
|
||||||
|
|
||||||
|
<a name="TelegramBot+verifyChat"></a>
|
||||||
|
|
||||||
|
### telegramBot.verifyChat(chatId) ⇒ <code>Promise</code>
|
||||||
|
This method verifies a chat [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||||
|
**Returns**: <code>Promise</code> - On success, returns true.
|
||||||
|
**See**: https://core.telegram.org/bots/api#verifychat
|
||||||
|
|
||||||
|
| Param | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| chatId | <code>Number</code> | Unique identifier of the target chat |
|
||||||
|
|
||||||
|
<a name="TelegramBot+removeUserVerification"></a>
|
||||||
|
|
||||||
|
### telegramBot.removeUserVerification(userId) ⇒ <code>Promise</code>
|
||||||
|
This method removes verification from a user who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||||
|
**Returns**: <code>Promise</code> - On success, returns true.
|
||||||
|
**See**: https://core.telegram.org/bots/api#removeuserverification
|
||||||
|
|
||||||
|
| Param | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| userId | <code>Number</code> | Unique identifier of the target user |
|
||||||
|
|
||||||
|
<a name="TelegramBot+removeChatVerification"></a>
|
||||||
|
|
||||||
|
### telegramBot.removeChatVerification(chatId) ⇒ <code>Promise</code>
|
||||||
|
This method removes verification from a chat who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
|
||||||
|
**Kind**: instance method of [<code>TelegramBot</code>](#TelegramBot)
|
||||||
|
**Returns**: <code>Promise</code> - On success, returns true.
|
||||||
|
**See**: https://core.telegram.org/bots/api#removechatverification
|
||||||
|
|
||||||
|
| Param | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| chatId | <code>Number</code> | Unique identifier of the target chat |
|
||||||
|
|
||||||
<a name="TelegramBot.errors"></a>
|
<a name="TelegramBot.errors"></a>
|
||||||
|
|
||||||
### TelegramBot.errors : <code>Object</code>
|
### TelegramBot.errors : <code>Object</code>
|
||||||
|
@ -3356,7 +3356,55 @@ class TelegramBot extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
sendGift(giftId, form = {}) {
|
sendGift(giftId, form = {}) {
|
||||||
form.gift_id = giftId;
|
form.gift_id = giftId;
|
||||||
return this._request('getAvailableGifts', { form });
|
return this._request('sendGift', { form });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method verifies a user [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
*
|
||||||
|
* @param {Number} userId Unique identifier of the target user
|
||||||
|
* @return {Promise} On success, returns true.
|
||||||
|
* @see https://core.telegram.org/bots/api#verifyuser
|
||||||
|
*/
|
||||||
|
verifyUser(userId, form = {}) {
|
||||||
|
form.user_id = userId;
|
||||||
|
return this._request('verifyUser', { form });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method verifies a chat [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
*
|
||||||
|
* @param {Number} chatId Unique identifier of the target chat
|
||||||
|
* @return {Promise} On success, returns true.
|
||||||
|
* @see https://core.telegram.org/bots/api#verifychat
|
||||||
|
*/
|
||||||
|
verifyChat(chatId, form = {}) {
|
||||||
|
form.chat_id = chatId;
|
||||||
|
return this._request('verifyChat', { form });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method removes verification from a user who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
*
|
||||||
|
* @param {Number} userId Unique identifier of the target user
|
||||||
|
* @return {Promise} On success, returns true.
|
||||||
|
* @see https://core.telegram.org/bots/api#removeuserverification
|
||||||
|
*/
|
||||||
|
removeUserVerification(userId, form = {}) {
|
||||||
|
form.user_id = userId;
|
||||||
|
return this._request('removeUserVerification', { form });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method removes verification from a chat who is currently verified [on behalf of the organization](https://telegram.org/verify#third-party-verification) which is represented by the bot.
|
||||||
|
*
|
||||||
|
* @param {Number} chatId Unique identifier of the target chat
|
||||||
|
* @return {Promise} On success, returns true.
|
||||||
|
* @see https://core.telegram.org/bots/api#removechatverification
|
||||||
|
*/
|
||||||
|
removeChatVerification(chatId, form = {}) {
|
||||||
|
form.chat_id = chatId;
|
||||||
|
return this._request('removeChatVerification', { form });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user