chat_id = message.chat.id
message_id = message.message_id # или message.id - в последних версиях есть такое
if message.reply_to.message is None:
bot.send_message(chat_id=chat_id, "Ответьте командой на сообщение", reply_to_message_id=message_id)
else:
id_to_kick = message.reply_to_message.from_user.id
bot.kick_chat_member(chat_id=chat_id, user_id=id_to_kick)
bot.send_message(chat_id=chat_id, "Пользователь кикнут", reply_to_message_id=message_id)
banned_users = []
def is_not_banned(func):
@wraps(func)
def decorator(message):
if message.from_user.id not in banned_users:
return func(message)
return decorator
class MyTeleBot(TeleBot):
def get_updates(self, *args, **kwargs):
json_updates = apihelper.get_updates(self.token, *args, **kwargs)
ret = []
for ju in json_updates:
if ju['message']['from']['id'] in banned_users:
self.last_update_id = ju['update_id']
else:
ret.append(types.Update.de_json(ju))
return ret
name = message.from_user.username #или
name = message.from_user.full_name
lang = message.from_user.locale