N
N
Nori Nyah2019-10-30 14:08:21
Node.js
Nori Nyah, 2019-10-30 14:08:21

How to use the restrictChatMember Telegraf.js command?

When using the restriceChatMember command, a 400 error occurs, stating that the specified user id is invalid. In the description of the error in the payload property, as I understand it, the passed parameters are chatId and userId.
And so, the userId is the same as the chat ID (although another one was specified, of course).
I take the chat and user IDs from the context object (Telegraf.js), namely ctx.chat.id and ctx.from.id. and the error keeps popping up. It's definitely not about the rights, since the bot has them. Who faced? maybe I'm using it incorrectly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nori Nyah, 2019-10-30
@KamikariCat

ctx.restrictChatMember() won't work. Since the docks say that there is a telegram object method, namely:
ctx.telegram.restrictChatMember(chatId, userId, {extra params})
I apologize for the stolen time, I missed it))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question