Skip to content

The Telegram Bot is built using the Ruby best practices and implementing Object Oriented Programming principles.

License

Notifications You must be signed in to change notification settings

Rumbie-Mudzie7/ruby-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RUBY-TELEGRAM-BOT

Screenshot

Screenshot

The Telegram Bot is a friendly bot, built using the Ruby best practices and implementing Object Oriented Programming principles.

The program creates and initializes a Telegram bot. The program then retrieves the first name of the account holder for a friendly greeting and advises them to use /start to start the bot, /stop to end the bot, /inspire to get a inspirational quote everytime you request for it or /joke to get a joke everytime it is requested.

🔧 Built with

Ruby Telegram BotFather : (https://core.telegram.org/bots/api) APIs : https://joke3.p.rapidapi.com/v1/joke https://quotes21.p.rapidapi.com/quote

🔴 Live Demo

https://www.loom.com/share/c600de47ed504c0097b9f20af89830ba

Getting Started

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

Prerequisites - Ruby, RubyGems and Telegram bot Make sure you have the latest version of Ruby installed for your operating system from https://www.ruby-lang.org/en/downloads/ Check using using 'ruby -v' on the command line or terminal to make sure it is at least version 2.1 and above.

Download and install latest RubyGems from https://rubygems.org/pages/download and then confirm it is updated by using 'gem update --system' or 'gem install rubygems-update' and 'update_rubygems' on the command line or terminal.

Install Telegram on your device from https://telegram.org/ and make sure you have a working telegram account.

With ruby installed and an account created, we also need to obtain a code from telegram called an A.P.I token. To do this we need the help of the bot father. Just type the command /new bot, and follow the instructions of the bot father.

Search for an API key, online that is compactible with your application to obtain an end-point-response url that returns either a joke or inspiration.

🔨 Setup

Name of Bot : RumbieBot Handle : @MyRyan

Install Gems From the command-line or terminal run the command 'gem list --local' to check if you have gems listed below, and if not then enter the command 'bundle install' to install the dependencies from the Gemfile, or use the following commands to install required gems manually as needed:

gem install telegram-bot-ruby

gem install dotenv

gem install rspec

In your working folder, create a .env text file. We then assign token and API keys, variables that we can use to run the bot and paste them inside the .env file. In each ruby file that we have created, we need to require 'dotenv', that is will be used to load the token key.

🔨 Usage

Make sure you are in the working folder or move to it using either one of the following on the command line or terminal: cd ruby-telegram-bot chdir ruby-telegram-bot

Run the program using the following:

ruby bin/main ctrl + C on command line to stop the program from running.

Run tests Run RSPEC tests using the following on the command line or terminal:

rspec

Author

👤 Rumbidzayi Mudziviri

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check the fork this repo and create pull request if you want to make changes.

👍 Show your support

Give a ⭐️ if you like this project!

👍 Acknowledgements

Muhammad Talha Waqar
[Marshall Akpan] (https://github.com/uimarshall)

License

This project is MIT licensed.

About

The Telegram Bot is built using the Ruby best practices and implementing Object Oriented Programming principles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages