Ruby implementation of a Telegram Bot giving out information about the first 151 characters of the famous Pokemon franchise using https://pokeapi.co/
This project was developed as a learning project part of the Microverse curriculum.
- Ruby
Step 1
Clone the repo to a local folder by inputting this command into your terminal
git clone https://github.com/marcode95/telegram-bot
Step 2
Run cd telegram-bot
and switch to the feature branch with
git checkout feature
Step 3
Run bundle install to install the gems from the Gemfile.
Step 4
Download the Telegram app, create an account, search for a new contact named Botfather.
Step 5
Press /start to start the conversation and /newbot to create a new bot (just follow the instructions). You will then receive an API Token that looks like this: 1347431199:AAH4hPt6PDiJB4swk23Lb4oOzwocjKpba0S4
Step 6
Go to lib/bot.rb, put your token into quotation marks to turn it into a string and replace Token.new.token in line 14 with it. Line 14 should look something like this afterwards: token = '1347431199:AAH4hPt6PDiJB4swk23Lb4oOzwocjKpba0S4'
Step 7
Delete line 5 "require_relative '../config.rb'"
Step 8
Run ruby ./bin/main.rb to start the bot.
Step 9
After creating your bot in telegram Botfather should have provided you with a link to access it. Press it.
Step 10
Type /hey to start and enjoy!
- /hey will start the bot
- /info will give you information about the abilities of the bot
- /random will give out information about a random pokemon
- /poke_nameofpokemon will give out information about a certain Pokemon of the first generation: https://en.wikipedia.org/wiki/List_of_generation_I_Pok%C3%A9mon
- /bye will end the bot
Ruby installed locally
To test this code download RSpec, access the repository using the terminal, write rspec and execute.
👤 Marco Erhardt
- Github: @marcode95
Contributions, issues and feature requests are welcome!
Give a ⭐️ if you like this project!
- Microverse for showing the way for this project to happen
- Contributors to PokeApi
