yagop / node-telegram-bot-api

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

Can't ban with user_id #1034

Closed mattou78400 closed 1 year ago

mattou78400 commented 1 year ago

Hi,

I'm trying to ban a user based on the user_id as per the method: https://core.telegram.org/bots/api#banchatmember

image

Here's how I call it

but I keep getting this error image

I'm sending in the ID I get from msg.from.id

Can someone point me what I am doing wrong?

thanks!

danielperez9430 commented 1 year ago

Because you pass wrong the params. The last param is a object with the optional params

bot.banChatMember(chatId, userId, { unitilDate })