yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.17k stars 1.5k forks source link

kickChatMember is not a function #1079

Closed uris173 closed 1 year ago

uris173 commented 1 year ago
let userId = msg.from.id
await bot.kickChatMember(chatId, userId)

kickChatMember function does not work. gives an error message

await bot.kickChatMember(chatId, userId)
                ^
TypeError: bot.kickChatMember is not a function
danielperez9430 commented 1 year ago

Hi @uris173 The method kickChatMember is not exists anymore in the Telegram bot api. Was remove a long time ago.

You need to use now the "banChatMember(chat_id, user_id, { until_date: XX })" for replicate the some logic

https://core.telegram.org/bots/api#banchatmember