Answer the question
In order to leave comments, you need to log in
How to send a message from a bot to a group chat?
I need to write a bot that would run on a schedule and send a message to the chat immediately after launch.
Sending messages to message_handler doesn't work for me as I need the bot to send the message first.
Now I have this code
from aiogram import Bot, Dispatcher, executor, types
import asyncio
loop = asyncio.get_event_loop()
bot = Bot(token=API_TOKEN, loop=loop)
dp = Dispatcher(bot)
async def send_file(chat_id):
await bot.send_document(chat_id, open('test.log', 'r'))
if __name__ == '__main__':
loop.create_task(send_file(chat_id='1826262178'))
executor.start_polling(dp, skip_updates=False)
Answer the question
In order to leave comments, you need to log in
As Roman Kitaev already wrote , in the model meta-class, you can define the name of the model in Russian or localized, and the name of the application can be defined in AppConfig .
Read the relevant documentation section
djbook.ru/rel1.8/topics/i18n/translation.html#how-...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question