1

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?

0stone0
  • 34,288
  • 4
  • 39
  • 64
  • 3
    You've placed your **private BOT token** in the question. I removed it, but it's still visible in the history. Consider renewing the token at @botFather to prevent other people abusing it! – 0stone0 Jun 01 '21 at 10:46

1 Answers1

2
def mut(message):
    bot.restrict_chat_member(message.chat.id, message.from_user.id, until_date=time()+86400)
MyZik
  • 220
  • 2
  • 15