Простая обёртка Django для ботов ТамТам. Готово к размещению на Heroku (не обязательно). Код самого бота размещается в файле \TtBot\TtBot.py
В текущем виде представляет собой вполне работоспособный бот с минимальной демонстрационной функциональностью.
- Клонировать текущий репозиторий, включая подмодули:
- git clone https://github.com/asvbkr/djh-box.git
- cd djh-box/
- git submodule init
- git submodule update
- При отсутствии, установить в используемый интерпретатор необходимые пакеты - см. requirements.txt
- Установить переменную среды TT_BOT_API_TOKEN - указать токен, полученный от @PrimeBot
- При необходимости:
- Установить переменную среды TT_BOT_TRACE_REQUESTS - вывод информации о всех запросах. Возможные значения - True или False
- Установить переменную среды TT_BOT_LOGGING_LEVEL - уровень логирования. Возможные значения - текстовые названия уровней из пакета logging. Например, DEBUG или WARNING
- Запустить на выполнение, например: python manage.py runserver 0.0.0.0:8000. Для работы в режиме webhooks всё готово
- Для работы в режиме longpolls:
- Старт - в браузере открыть адрес запущенного приложения с окончанием /start_polling
- Стоп - в браузере открыть адрес запущенного приложения с окончанием /stop_polling
- Бот с минимальной функциональностью готов.
A simple Django wrapper for TamTam bots. Ready to be hosted on Heroku (optional). The bot code is in the file \TtBot\TtBot.py
In its current form it is a fully functional bot with a minimum demo functionality.
- Clone current repository, including the submodules:
- git clone https://github.com/asvbkr/djh-box.git
- cd djh-box/
- git submodule init
- git submodule update
- install the required packages into the interpreter you are using - see requirements.txt
- Set the environment variable TT_BOT_API_TOKEN - specify the token, received from @PrimeBot
- If necessary:
- Set the environment variable TT_BOT_TRACE_REQUESTS - display information about all queries. Possible values are True or False
- Set environment variable TT_BOT_LOGGING_LEVEL - logging level. Possible values are text level names from the logging package. For example, DEBUG or WARNING
- Run, for example: python manage.py runserver 0.0.0.0:8000. For mode webhooks all ready
- To operate in a mode longpolls:
- Start in the browser to open a running application from the end /start_polling the
- Stop the browser to open a running application from the end /stop_polling
- Bot with minimal functionality is ready to use.