Answer the question
In order to leave comments, you need to log in
How to find out that I threw a replay on the bot?
I need something when I replay a user or a bot. For example, the /test command, the bot checked who it is, a bot or a user.
@dp.message_handler(commands=['test'])
async def test(message: types.Message):
await message.reply('Это пользователь')
await message.reply('Это бот')
Answer the question
In order to leave comments, you need to log in
from aiogram import types
from aiogram.dispatcher.filters import Command
@dp.message_handler(Command('test'))
async def test(message: types.Message):
if message.reply_to_message.from_user.is_bot:
await message.answer(text='This is bot')
else:
await message.answer(text='This is user')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question