Code Monkey home page Code Monkey logo

telegram-dmi-bot's Introduction

Telegram-DMI-Bot

Telegram-DMI-Bot is the platform that powers @DMI_bot, a Telegram bot aided at helping students find informations about professors, classes' schedules, administration's office hours and more.

Using the live version

The bot is live on Telegram with the username @DMI_Bot. Send '/start' to start it, '/help' to see a list of commands.

Please note that the commands and their answers are in Italian.


Setting up a local istance

If you want to test the bot by creating your personal istance, follow this steps:

  • Clone this repository or download it as zip.
  • Send a message to your bot on Telegram, even '/start' will do. If you don't, you could get an error
  • Copy the file data/DMI_DB.db.dist into data/DMI_DB.db to enable the database sqlite
  • Copy the file config/settings.yaml.dist into config/settings.yaml (If you don't have a token, message Telegram's @BotFather to create a bot and get a token for it)
  • Now you can launch "main.py" with your Python3 interpreter

System requirements

  • Python 3
  • python-pip3
  • language-pack-it

To install with pip3

  • python-telegram-bot
  • pydrive
  • requests
  • xlrd
  • beautifulsoup4
  • python-gitlab

Special functions

Notes: only some users are allowed to use these commands indeed there is an if condition that check the chatid of the user that can use them

- /stats

You can enable these commands setting disable_db = 0 and copy data/DMI_DB.db.dist into data/DMI_DB.db

This command shows the statistics of the times where the commands are used in the last 30 days.

- /drive /request /adddb

You can enable these commands setting disable_drive = 0, configure the GoogleDrive credentials and copy data/DMI_DB.db.dist into data/DMI_DB.db.

/drive: command to get the GoogleDrive files /request allows the user to send the subscribe request to get the access for /drive /adddb allows some special users to give the access to /drive to another user

Configure Drive
  • open a project on the Google Console Developer
  • enable Drive API
  • download the drive_credentials.json and put it on config/
  • copy config/settings.yaml.dist into config/settings.yaml, then configure it

Docker container

How to use

Build image dmibot with docker:

$ docker build ./ -t dmibot --build-arg TOKEN=<token_API>

Run the container dmibot:

$ docker run -it dmibot

Now you can go to the dmibot directory and run the bot:

$ cd /usr/local/dmibot/
$ python main.py

License

This open-source software is published under the GNU General Public License (GNU GPL) version 3. Please refer to the "LICENSE" file of this project for the full text.

Credits

This project is made possible thanks to the contributions of:

telegram-dmi-bot's People

Contributors

helias avatar tkd-alex avatar veeenz avatar simone989 avatar herbrant avatar pierpaolo791 avatar adrianoferraguto avatar wornairz avatar aegroto avatar wredan avatar beasthunter19 avatar daedalus9 avatar

Watchers

James Cloos 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.