mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Bot API 5.4
This commit is contained in:
11
examples/chat_join_request.py
Normal file
11
examples/chat_join_request.py
Normal file
@ -0,0 +1,11 @@
|
||||
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)
|
Reference in New Issue
Block a user