Skip to content
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

Merged
merged 3 commits into from
May 1, 2024

Conversation

merkme
Copy link
Contributor

@merkme merkme commented Apr 27, 2024

Запуск бота реализован через managment/commands.

Запуск бота python manage.py runbot схоже с runserver, поэтому выбрал такое имя.

Создал так же handlers.py, добавил обработчик для команды /start и для реализации функции бота в режиме эхо.

Так как пока environ не реализован и задача по его добавлению ещё не реализована, написал текст заглушку в settings.py.

Удалил несколько ненужных файлов из директории приложения bot.

image

UPD:
Исправил всё, что было указано в комментариях. Поборол проблемы связки Django + python. При запуске команды python manage.py runserver запускается приложение и сам бот.

@merkme merkme self-assigned this Apr 27, 2024
src/bot/handlers.py Outdated Show resolved Hide resolved
src/bot/management/commands/runbot.py Outdated Show resolved Hide resolved
src/core/settings.py Show resolved Hide resolved
@merkme merkme force-pushed the feature/echo_bot branch 3 times, most recently from 6585e32 to 69b1563 Compare April 29, 2024 09:18
test.py Outdated Show resolved Hide resolved
test.py Outdated Show resolved Hide resolved
src/core/logging/__init__.py Outdated Show resolved Hide resolved
from core.logging import log_errors


async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

То есть скрипт test.py случайно попал? Теперь понял) Но комментарии к нему сюда тогда относятся

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, абсолютно случайно попал сюда файл test.py, я пытался вне django запустить бота и проверить его функционал) забыл удалить файл. Комментарии все применил.

src/bot/bot_interface.py Show resolved Hide resolved
src/bot/bot_interface.py Outdated Show resolved Hide resolved
@merkme merkme force-pushed the feature/echo_bot branch 3 times, most recently from 2f7dfb1 to a717253 Compare April 30, 2024 09:30
@merkme merkme linked an issue Apr 30, 2024 that may be closed by this pull request
Copy link
Member

@KonstantinRaikhert KonstantinRaikhert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, отлично! В работу)

@KonstantinRaikhert KonstantinRaikhert merged commit 7422dae into dev May 1, 2024
@merkme merkme deleted the feature/echo_bot branch May 6, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Создать эхо бота
3 participants