2021-11-27 21:41:39 +03:00
|
|
|
from telebot.async_telebot import AsyncTeleBot
|
|
|
|
import telebot
|
2021-11-27 23:04:49 +03:00
|
|
|
|
2021-11-27 21:41:39 +03:00
|
|
|
bot = AsyncTeleBot('TOKEN')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check if message is a reply
|
|
|
|
@bot.message_handler(is_reply=True)
|
|
|
|
async def start_filter(message):
|
|
|
|
await bot.send_message(message.chat.id, "Looks like you replied to my message.")
|
|
|
|
|
|
|
|
# Check if message was forwarded
|
|
|
|
@bot.message_handler(is_forwarded=True)
|
|
|
|
async def text_filter(message):
|
|
|
|
await bot.send_message(message.chat.id, "I do not accept forwarded messages!")
|
|
|
|
|
|
|
|
# Do not forget to register filters
|
|
|
|
bot.add_custom_filter(telebot.asyncio_filters.IsReplyFilter())
|
|
|
|
bot.add_custom_filter(telebot.asyncio_filters.ForwardFilter())
|
|
|
|
|
2021-11-27 23:04:49 +03:00
|
|
|
bot.polling()
|