Telegram bot for booking auditorium
See help.txt
for information about commands (it is in russian, not trasnslated into english yet).
You can also see documentation in python code.
Bot settings should be set as environment variables.
Environment variable TOKEN
should be set to token for Telegram API.
Important notice: this data should be kept private for security reasons.
Environment variable CONTACTLIST_FILE
should be set to name of contact list file, default value is ../BookingBot-data/contacts.txt
.
This is text file, its content will be displayed to users who type /contactlist
command.
Environment variable TELEGRAM_PROXY
should be set to proxy configuration.
It should contain proxy type, space character and proxy URL.
Example:
export TELEGRAM_PROXY="https https://192.168.0.228:8080"
Or, if no proxy should be used:
export TELEGRAM_PROXY=none
Environment variable DATABASE_URL
should be set to database URL (see playhouse.db_url.connect documentation), default value is sqlite:/../BookingBot-data/data.db
.
Example:
export DATABASE_URL="postgresql://bookingbot:password@localhost:5432/bookingbot"
Or:
export DATABASE_URL="sqlite:/../BookingBot-data/data.db"
Environment variable BOT_LOG
should be set to log file name, default value is ../BookingBot-data/log.log
.
Log will be appended to this file.
Environment variable BOT_CALENDAR_LOCALE
should be set to locale used for rendering calendar, if it is not set, system locale is used.
Example:
export BOT_CALENDAR_LOCALE=ru_RU.UTF-8
Environment variable THREAD_NUMBER
should be set to thread count for bot, default value is 2
.
Example:
export THREAD_NUMBER=8
Management script is named manage.py
.
Whitelist can be added to database from file using following command:
python ./manage.py load-whitelist FILENAME
Each line of file should contain either user ID of user, or comment, begining with the # character.
Example:
#This is whitelist
252070907
#124889533
Administrators can be added from file using following command:
python ./manage.py load-admins FILENAME
Each line of file should contain either user ID of amdministrator, or comment, begining with the # character.
Example:
#This is admin list
252070907
#124889533
User can be made administator using following command:
python ./manage.py op-username USERNAME
User can be made not administator using following command:
python ./manage.py deop-username USERNAME