[英]Telegram bot api not able to restrict user for 24 hours
尋找一種使用restrictChatMember()
限制聊天成員的解決方案,但不幸的是,它仍然永遠限制用戶24小時。
const { date:joinDate } = ctx.message;
const releaseDate = moment.unix(joinDate).add(1, 'day');
ctx.telegram.restrictChatMember(
ctx.chat.id,
memberID,
releaseDate,
false,
false,
false,
false
);
您是將moment
對象傳遞回函數,而不是像您引用的文檔所說的那樣是UNIX時間戳:
until_date
:可選整數
取消限制日期的日期,Unix時間。 如果從當前時間起限制用戶使用超過366天或少於30秒,則將其視為永遠受限制。
嘗試
ctx.telegram.restrictChatMember(
ctx.chat.id,
memberID,
releaseDate.unix(),
...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.