Answer the question
In order to leave comments, you need to log in
How to send messages to yourself through a telegram bot?
How can I send a message to myself with a certain text through a bot?
I use this function:
def send():
Bot.send_message(chat_id=MY_ID, text='hello')
send()
Answer the question
In order to leave comments, you need to log in
A mistake, in fact, it is necessary to show, who will decide what, I don’t know what?
But let me povang.
First, Bot is a class. You need to create an instance of it:
from aiogram import Bot
bot = Bot(token=config.bot_token)
async def main():
await bot.send_message(my_chat_id, my_message)
await bot.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question