繁体   English   中英

让 Telebot 将新用户静音 24 小时

[英]Make telebot mute new user for 24 hours

我有这个代码

import time
from time import time
bot = telebot.TeleBot('<MY-BOT-TOKEN>')
@bot.message_handler(content_types=[
    "new_chat_members"
])
def mut(message):
    bot.restrict_chat_member(message.chat.id, USER_ID , until_date=time()+86400)

它会监听新用户,并且有静音命令,但我如何通过 TeleBot 获取他们的 ID?

def mut(message):
    bot.restrict_chat_member(message.chat.id, message.from_user.id, until_date=time()+86400)

暂无
暂无

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

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