1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00
pyTelegramBotAPI/examples/asynchronous_telebot/chat_join_request.py

12 lines
377 B
Python
Raw Normal View History

2021-11-27 21:41:39 +03:00
from telebot.async_telebot import AsyncTeleBot
2021-11-27 23:04:49 +03:00
2021-11-27 21:41:39 +03:00
import telebot
bot = AsyncTeleBot('TOKEN')
@bot.chat_join_request_handler()
async def make_some(message: telebot.types.ChatJoinRequest):
await bot.send_message(message.chat.id, 'I accepted a new user!')
await bot.approve_chat_join_request(message.chat.id, message.from_user.id)
2021-12-12 13:07:30 +03:00
import asyncio
asyncio.run(bot.polling())