V
V
Vladimir Vladimirovich2020-07-18 18:48:57
Python
Vladimir Vladimirovich, 2020-07-18 18:48:57

Bot uploaded to heroku not responding to messages, why?

Hello!
I made a simple bot, I wanted to upload to Heroku, everything went fine, the assembly was successful, but the bot does not respond to messages
The bot code is:

import logging
import asyncio
from aiogram import Bot, Dispatcher, executor, types

@dp.message_handler(commands=['start'])
async def send_welcome(message: types.Message):
    await bot.send_message(message.from_user.id , 'привет!', disable_web_page_preview='true')

if __name__ == '__main__':
    executor.start_polling(dp, skip_updates=True)


5f1319a1395ae209646499.png

If suddenly someone has done this, can you tell me what the problem is?
Perhaps this is due to the fact that the bot is on aiogram, and ordinary polling is not enough there, but I also wanted to deploy the bot on another library, and still the bot did not respond to messages ..
Here are the logs:
2020-07-18T18:19:07.426942+00:00 app[worker.1]: python: can't open file 'bot.py': [Errno 2] No such file or directory
2020-07-18T18:19:07.486954+00:00 heroku[worker.1]: Process exited with status 2
2020-07-18T18:19:07.536252+00:00 heroku[worker.1]: State changed from up to crashed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2020-07-19
@2ord

You need to make sure that all files are checked into the Git repository and also that the package versions are compatible with the Python version.

J
Jan, 2020-07-24
@Buchachalo

Judging by the log, aiogram wants 3.7+, but you have 3.6.11 on Heroku. When creating a Dyno, install a higher version of Pi. There is a manual in the documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question