The Ruby - ChatBot is a tool that helps the user to boost their daily routine with some jokes and motivational phrases. The overall intention is to help people to boost their productivity or change their mood status.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
Ruby installed on your local machine. telegram account bundle installed on your machine rspec (optional) Terminal or similar to execute the program.
This is an example of how you may give instructions on setting up your project locally. Modify this file to match your project, remove sections that don't apply. For example: delete the testing section if the currect project doesn't require testing.
- To get a local copy up and running follow these simple example steps.
- Clone this repository with git clone
https://github.com/sergiocortessat/Ruby-Capstone-ChatBot
using your terminal or command line. - Change to the project directory by entering :
cd Ruby-Capstone-ChatBot
in the terminal . - run the command
ruby /bin main.rb
- For a starter, you must have a telegram account or create one. Once you do this, please continue the next steps
- Once you are inside your telegram app and account, go to the search bar and seek for @BotFather. This default contact is telegrams own bot-making tools. Open and start a new conversation.
- type in the text are: '/newbot'. This is the telegrams command to get you started. Make sure to follow its instructions.
- First, you must choose a name for the bot.
- Second, you will be prompt to place a username
- Finally it will provide you with a hash-key token. make sure to save it.
- The repository should be now cloned to your machine. Make sure to be inside the main folder with: cd Ruby-Capstone-bot
- (Optional) Direct yourself to the file called token.rb and open it. Please fill the mandatory empty field 'token_key' and save the file
- Make sure you have Bundler installed in your machine ("gem install bundler").
- Enter the terminal and make sure you are located in the main-directory.
- Enter the command 'bundle install' in your terminal. This will install the basic dependencies in the Gemfile.
- Once this is done, run the command ruby bin/main.rb in your terminal. This should start the bot.
- Please make sure to read the instructions. Enter 'Y' if you want to enter manually your token key. Otherwise pres 'N' (Warning: If you select 'N' Make sure to have the token saved in the file token.rb. Read step 8)
- If you have correctly entered your token key in the terminal or the token.rb file, the bot should be running and ready to use. Please don't close it.
- Please direct yourself to Telegram once again and search for the username you gave to the bot (you can click on the link given by FatherBot).
- Start a conversation. Please use commands 'hello', 'options', 'jokes','motivation', 'stock' or 'who'
- 'hello' will prompt a nice welcome message.
- 'who' will provide some basic info about the bot itself.
- 'options' will provide all options available for the bot
- 'joke' will provide you with daily jokes
- 'motivation' will provide wonderful random quotes for you
- 'stock provides the latest stock price market for Tesla motros INC.
You can autonomously alter the messages and commands in bot.rb to something you prefer.
In this project, the testing was done using RSpec to test logic specs.
- In a terminal window type gem install RSpec
- Once RSpec install has finished, type RSpec --init
- You will see a folder spec and a file .rspec
- Inside spec folder, you'll see a spec_helper.rb file.
The testing file is included in spec folder under logicrspec.rb.
- go to the folder spec:
- cd spec
- Inside your terminal type:
- RSpec logicrspec.rb
- All test should pass and you shall see:
9 examples, 0 failures
for logicrspec.rb
👤 Sergio Cortes Satizabal
- Github: @sergiocortessat
- Twitter: @sergiocortessat
Project Link: Ruby-capstone