-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added the start function and initiated the bot in echo mode #10
Conversation
6585e32
to
69b1563
Compare
from core.logging import log_errors | ||
|
||
|
||
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
То есть скрипт test.py случайно попал? Теперь понял) Но комментарии к нему сюда тогда относятся
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, абсолютно случайно попал сюда файл test.py, я пытался вне django запустить бота и проверить его функционал) забыл удалить файл. Комментарии все применил.
2f7dfb1
to
a717253
Compare
a717253
to
5d45b81
Compare
5d45b81
to
fca7d22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, отлично! В работу)
Запуск бота реализован через managment/commands.
Запуск бота
python manage.py runbot
схоже с runserver, поэтому выбрал такое имя.Создал так же handlers.py, добавил обработчик для команды
/start
и для реализации функции бота в режиме эхо.Так как пока environ не реализован и задача по его добавлению ещё не реализована, написал текст заглушку в settings.py.
Удалил несколько ненужных файлов из директории приложения bot.
UPD:
Исправил всё, что было указано в комментариях. Поборол проблемы связки Django + python. При запуске команды python manage.py runserver запускается приложение и сам бот.