pyTelegramBotAPI/examples/chat_join_request.py

11 lines
338 B
Python
Raw Permalink Normal View History

2021-11-06 10:15:28 +03:00
import telebot
bot = telebot.TeleBot('TOKEN')
@bot.chat_join_request_handler()
def make_some(message: telebot.types.ChatJoinRequest):
bot.send_message(message.chat.id, 'I accepted a new user!')
bot.approve_chat_join_request(message.chat.id, message.from_user.id)
bot.infinity_polling(allowed_updates=telebot.util.update_types)