yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.45k stars 1.53k forks source link

createChatInviteLink not working for 1 member #930

Closed siddhant-rigi closed 2 years ago

siddhant-rigi commented 2 years ago

I am using the latest version of the library.

And when I call the createChatInviteLink for creating a link for only 1 member

bot.createChatInviteLink(-1001607656072, "random", 2525457042, 1, false) like that

I am getting this error

aa TypeError: Cannot create property 'chat_id' on string 'random'

danielperez9430 commented 2 years ago

Hi @siddhant-rigi

Check this example of use: https://github.com/yagop/node-telegram-bot-api/pull/859#issuecomment-794267399

createChatInviteLink() have 2 params, first chat_id and second optional param that is object with "optional" params.

Reference: https://core.telegram.org/bots/api#createchatinvitelink

siddhant-rigi commented 2 years ago

Thanks it worked.