This project explores the power of Ruby to integrate with the Telegram Bot API.
About | Installations | Usage | Testing | Built With | Author
This project involves building a Telegram bot using Ruby and the Telegram bot API wrapper. Ruby classes and methods are used to create the bot functionality while the Ruby Telegram bot API wrapper gem is used to connect to the Telegram bot API. The net-http-persistent gem is used to connect to other external APIs. The Telegram bot built in this repository provides random bible verses and the latest real-time news headlines in the US.
- Ruby 2.6.6
- Telegram Bot API -
telegram-bot-ruby (0.12.0) - net/http -
net-http-persistent (4.0.0, 2.9.4)
- RSpec 3.9
To use the verse&newsbot, follow the steps in this section
First get a copy of project on your computer:
- Clone or download the repository to a local directory on your computer by following the Github instructions.
Once you have a local copy of the entire project on your computer, then:
- Run
bundle installin the terminal to install the gem dependencies in the Gemfile. - Verify that all the gems in the Gemfile have been installed
. Rungem info telegram-bot-rubyin the terminal to check that this gem is installed
. Rungem info net-http-persistentin the terminal to check that this gem is installed
If you like to test the ruby methods used, then:
- run
rspec -vin the terminal to check if the previousbundle installterminal command installed rspec in the Gemfile. - if not, add gem 'rspec' on a new line in the Gemfile and run
bundle installin the terminal again to install rspec. - run
rspecin the terminal to test the methods used in this project.
Finally, you can use the verse&newsbot:
- run
ruby ./bin/script.rbin the terminal to execute the ruby script. - Open your browser and load this URL https://web.telegram.org/#/im?p=@knowbiblebot.
- If not, signin to your telegram account and you should be able to chat with the bot.
Alternatively: After running the ruby ./bin/script.rb command in the terminal, you can signin to your telegram account and type @knowbiblebot in the search area instead of loading the above URL.
👤 Mworekwa Ezekiel
- Github: @vanheaven-ui
- Twitter: @MworekwaE
- Linkedin: @linkedin
- Email: ezekiel
Contributions, issues and feature requests are welcome!
Feel free to check the issues page.
Give a ⭐️ if you like this project!
