簡體   English   中英

Node.js Telegram bot 無法將用戶踢出超級組

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

我正在嘗試創建一個邏輯系統來從私人超級組中踢出用戶名。 但是,當 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. 

我在句柄內調用 function : $.kickChatMember(groupid, userid); 謝謝!

解決了。 我的代碼錯了,當我們使用 scope 時,它會自動發送聊天的 id,所以:我們只需要發送 userid 作為參數: $.kickChatMember(userid);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM