/Inspiration-Bot

This is a Telegram bot that gives inspiring messages

Primary LanguageRuby

hire-badge Twitter Follow

Contributors Forks

Inspiration-Bot

This is a Ruby based Telegram bot that gives inspiring messages on request from the user with notifications and reminders to document their thoughts. It is a church bot that was built to aid church members to remember the word of God. This will remind them daily of their faith and testimonies to keep them going. I hope to make it permanently running for use.

Product Name Screen Shot

Features

  1. This bot provides an inspiring word to the user on request.

  2. The user can choose to write/create their thoughts, view or delete them.

  3. It gives scheduled reminders every 12 hours which is twice daily. The three reminders are:

    • An inspiring word
    • A reminder to document a testimony.
    • A reminder of their testimony entry at random.

To Check it out

  1. Visit The GLA Buddy on Telegram.

  2. Send the '/help' message to the bot for a list of functional details. Here is a list of available commands:

    • /start - to enable notifications
    • /stop - to stop notifications
    • /write - to make an entry
    • /view - to view all your entries
    • /delete - to delete an entry
    • /cancel - to cancel writing or deleting
    • /word - to receive an inspiring word

Demo

You can see it working here

How it works

There are two parts that run: - the main.rb waits for the commands from the user and replies. - the timed.rb sends reminders to the user that has accepted to receive them.

There is a basic database manager module that gives the classes control over the text files which make up the database folder.

There are 3 classes: - The SaveMessage class contains the methods to save thought entries from the user. It controls the view feature that allows the user to view their entries and delete them. A new text file is created to save each user's data upon new entry. - The StateManager class alerts the bot on what each user would like to do. It creates a file upon selection of any option. - The UserPrompts class contains all the replies that the bot will send to the user which are: the /start, /stop, /write, /view, /delete, /cancel, /help and /word.

Built With

  • Ruby
  • Rspec(code testing)
  • Rubocop(code linting)

Getting Started

To get a local copy up and running follow these steps:

Prerequisites

  • Ruby installed on local machine
  • Forking the project
  • Cloning the project to your local machine
  • cd into the project directory
  • Install the gems in the Gemfile by using the bundle install in the root folder terminal
  • After installing the gems, get your api key from Telegram's BotFather from the Telegram API docs and create a .env file in your root folder and on the first line place: API_KEY= 'YOUR-TELEGRAM-API-KEY'

Usage

  • Fork/Clone this project to your local machine.
  • Unit tests were built in Rspec, test using rspec in root directory of the project.

Author

👤 Glory David

Contribution

Contributions, issues and feature requests are welcome! Start by: * Forking the project * Cloning the project to your local machine * cd into the project directory * Run git checkout -b your-branch-name * Make your contributions * Push your branch up to your forked repository * Open a Pull Request with a detailed description to the development branch of the original project for a review

Show your support

Give a ⭐️ if you like this project!

Acknowledgements

📝 License

The project is licensed under MIT.