简体   繁体   English

Node.js Telegram bot 无法将用户踢出超级组

[英]Node.js Telegram bot can't kick user from supergroup

I'm trying to create a logic system to kick a username from a private supergroup.我正在尝试创建一个逻辑系统来从私人超级组中踢出用户名。 But, when function is running I'm returning:但是,当 function 正在运行时,我正在返回:

Api error: Body: {
  ok: false,
  error_code: 400,
  description: 'Bad Request: wrong user_id specified'
}


(node:11272) UnhandledPromiseRejectionWarning: #<TelegramApiError>
(node:11272) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11272) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 

I'm calling the function inside a handle with: $.kickChatMember(groupid, userid);我在句柄内调用 function : $.kickChatMember(groupid, userid); Thank you!谢谢!

It's solved.解决了。 My code was wrong, When we use an scope, it sends automatically the id of chat, so: we just need to send userid as parametre: $.kickChatMember(userid);我的代码错了,当我们使用 scope 时,它会自动发送聊天的 id,所以:我们只需要发送 userid 作为参数: $.kickChatMember(userid);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM