Answer the question
In order to leave comments, you need to log in
How to send a file to aiogram?
In order to make an echo bot, I had to write the following code:
bot = Bot(token = TOKEN)
mybot = Dispatcher(bot)
@mybot.message_handler(content_types = ContentType.TEXT)
async def messages(message: types.Message):
await message.reply(message.text)
if __name__ == '__main__':
executor.start_polling(mybot)
@mybot.message_handler(commands = 'file')
async def send_file(message: types.Document):
await message.reply(open('settings\\settings.py', 'r'))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question