Skip to content

A slack bot built with the goal to automate jokes and humor mainly popular within the developers community.

License

Notifications You must be signed in to change notification settings

oxenprogrammer/nerd-bot

Repository files navigation

Capstone Project: Ruby: Slack Bot

nerd-bot is a bot built with the goal to automate jokes and humor mainly popular within the developers community. Most times we developers/programmers get tired writing code and since https://www.slack.com is where most of our interaction occurs, it's not uncommon to just chat with a bot cracking jokes as your teammates might still be busy, nice right? Nerd-bot scraps the web and returns you random jokes in form of images or text given the right commands in slack.

Screenshot

screenshot

Built With

Getting Started

Slack Workspace

  • You will need to create a new slackwork space
  • Head over to http://slack.com/services/new/bot
  • Give your bot a name
  • Configure it as you desire and save integration
  • Save the SLACK_API_TOKEN string that starts with xoxb, you will need it later
  • Head over to slack and you will see your bot

Ruby Project

  • Clone this project locally
  • Run git checkout feat/slack-bot in the terminal
  • Run bundle to install Gems and their dependencies.
  • Create a .env file and paste your earlier saved SLACK_API_KEY
  • Check the .env.example file on how to do it
  • Run bundle exec rackup to start it the server
  • Your bot should be working by now

Running Test

  • Test have been built using Rspec as Test Runner and Fixture
  • Test Coverage by SimpleCov
  • Run rspec to run the test
  • On windows run open coverage/index.html for code coverage
  • On unix based systems run xdg-open coverage/index.html for code coverage

Testing on Slack

  • The bot can be invited into other workspace or direct messaged
  • Use @bot_username jokes_image to get programming jokes as images where @bot_username is the name of your bot
  • Use @bot_username jokes_text to get programming jokes as texts
  • Use @bot_username say_hello to greet the bot
  • The @bot_username is optional while talking in a Direct message with the bot
  • Type @bot_username help for the above commands
  • Enjoy

Author

👤 Emmanuel Okello

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Acknowledgments

Show your support

Give a ⭐️ if you like this project!

📝 License

This project is MIT licensed.

About

A slack bot built with the goal to automate jokes and humor mainly popular within the developers community.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published