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

Middlewares, new file, and examples

This commit is contained in:
_run
2021-11-27 23:41:39 +05:00
parent 6770011dd7
commit a9b422783f
15 changed files with 3178 additions and 2831 deletions

View File

@@ -0,0 +1,11 @@
from telebot.async_telebot import AsyncTeleBot
import asyncio
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)
asyncio.run(bot.polling(skip_pending=True))