Git Product home page Git Product logo

bookingbot's Introduction

BookingBot

Codacy Badge

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.

Configuration

Bot settings should be set as environment variables.

Token

Environment variable TOKEN should be set to token for Telegram API.

Important notice: this data should be kept private for security reasons.

Contact list file

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.

Proxy file

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

Database

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"

Log file

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.

Calendar locale

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

Thread count

Environment variable THREAD_NUMBER should be set to thread count for bot, default value is 2.

Example:

export THREAD_NUMBER=8

Management

Management script is named manage.py.

Loading whitelist file

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

Loading administrator list file

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

Adding administrator

User can be made administator using following command:

python ./manage.py op-username USERNAME

Removing administrator

User can be made not administator using following command:

python ./manage.py deop-username USERNAME

bookingbot's People

Contributors

artushak avatar codacy-badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.