2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 14:25:57 +00:00

Bot API 5.1: Support Improved Invite Links and new messageTypes (#859)

* Add new method sendPoll

* getMyCommands

* setMyCommands

* Update doc/api

* 1# Fix Test sendPhoto

The sendPhoto method does not support .gif files, use sendAnimation.

This fix remplace .gif file by .png

* CustomTitle and ChatPermissions support

setChatAdministratorCustomTitle
setChatPermissions

* Update Readme

Update Badge Telegram API Version

* Minor Fix and Fix setChatPhoto

The Telegram Bots api has a bug that they are fixing and gives problems with the previous image. While they don't fix it, the image replacement is the fastest solution

* Minor Fix and Add Test

Fixed setChatPermissions

Test:
- sendDice
- getMyCommands
- setMyCommands
- setChatAdministratorCustomTitle
- setChatPermissions

* Update Changelog and Package.json version

* Fix typos in Changelog

* Add support for poll_answer

From: https://github.com/yagop/node-telegram-bot-api/pull/777

* Add JieJiSS contribution in Changelog

* Add sendPoll Test

* Add unpinAllChatMessages Support

* Add copyMessage support

* Add close and logOut Support

* Add Test + Minor fixes

* Update CHANGELOG

Update version 0.50.1

* Update Readme Bot API Badge

* Update Version to 0.51.0

* Bot API 5.1 support Improved Invite Links

- Added the method createChatInviteLink
- Added the method editChatInviteLink
- Added the method revokeChatInviteLink

* Update version to 0.52.0 and new tests

- Update Changelog
- New Test
- Update version to 0.52.0

* Add new messageTypes

-  voice_chat_started
-  voice_chat_ended
- voice_chat_participants_invited

* Update Changelog and add new MessageType

* New messageTypes and updates

Add support for new messageTypes:
  - chat_invite_link
  - chat_member_updated

Add support for new updates:
 - my_chat_member
 - chat_member
This commit is contained in:
Daniel Pérez Fernández
2021-03-29 16:37:10 +02:00
committed by GitHub
parent 28cd62e355
commit de76dcd2cb
6 changed files with 563 additions and 552 deletions

View File

@@ -901,6 +901,33 @@ describe('TelegramBot', function telegramSuite() {
});
});
describe('#createChatInviteLink', function createChatInviteLinkSuite() {
let inviteLink;
before(function before() {
utils.handleRatelimit(bot, 'createChatInviteLink', this);
utils.handleRatelimit(bot, 'editChatInviteLink', this);
utils.handleRatelimit(bot, 'revokeChatInviteLink', this);
});
it('should create a chat invite link', function test() {
return bot.createChatInviteLink(GROUPID).then(resp => {
assert(resp.invite_link.match(/^https:\/\/t\.me\/joinchat\/.+$/i), 'is a telegram invite link');
inviteLink = resp.invite_link;
});
});
it('should edit chat invite link', function test() {
return bot.editChatInviteLink(GROUPID, inviteLink, { member_limit: 3 }).then(resp => {
assert.strictEqual(resp.member_limit, 3);
});
});
it('should revoke chat invite link', function test() {
return bot.revokeChatInviteLink(GROUPID, inviteLink).then(resp => {
assert.strictEqual(resp.is_revoked, true);
});
});
});
describe('#setChatPhoto', function setChatPhotoSuite() {
this.timeout(timeout);
before(function before() {