Answer the question
In order to leave comments, you need to log in
How to use the aiogram library to make the bot send a message to your id?
The code:
@mybot.message_handler()
async def echo(message: types.Message):
await message.answer(message, chat_id = 627976213)
Answer the question
In order to leave comments, you need to log in
method answer
does not accept chat_id parameter
use
await mybot.bot.send_message(chat_id = 123, text=message.text)
await mybot.bot.send_message(627976213, message.text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question