[英]Make telebot mute new user for 24 hours
I have this code我有这个代码
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)
It listens for new users, and it has mute command, but how can i get their ID with TeleBot?它会监听新用户,并且有静音命令,但我如何通过 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.