pointerish / Chatterton

A Discord bot that tells jokes, provides Apex Legends player stats, Today In History facts, and jokes to your inbox whenever mentioned.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chatterton

A Discord bot that tells jokes, provides Apex Legends player stats, tells random Today In History facts and that sends you a joke through PM whenever mentioned.

Chatterton is named after the poet Thomas Chatterton whose appearace has been gracefully disguised with ThugLife glasses above.

Available Commands

  • !stats: Provides Apex Legends player stats.
    • Usage: !stats PLATFORM NICKNAME. PLATFORM needs to be replaced by the platform. This can be either origin, PSN or XBOX. NICKNAME is the name of the of player.
  • !tih: Short for Today In History. Gives you a historical fact for current date randomly selected from here.
  • !joke: Tells you a joke! This was implemented by consuming the JokeAPI.
  • !commands: Does what I just did: tells you what are the available commands.

Installation

Chatterton uses the dotenv gem in order to access Environment Variables for the required API key and Discord Token.

Follow the next steps to configure all that's needed:

  • Download/clone this repo to your local machine
  • Execute touch .env from the projects root directory
  • Go to Discord's Developer Portal to create a new App and click on the New Application purple button

  • Give it a name once created click on Bot on the left column

  • Now click on the Copy button

  • On your .env file add your token like this
    • DISCORD_TOKEN=PLACE_TOKEN_HERE
  • To get the Apex Legends Tracker API go here:
  • Put that key on your .env file as follows:
    • APEX_API=PLACE_API_KEY_HERE
  • Run bundle install from the project's root directory to install dependencies.
  • Run `bundle exec bin/chatterton.rb'

Inviting the bot to your server

Before actually using the bot on your server you need to invite it. The best step by step tutorial to do so can be found here.

Once you have invited the bot to your server you can start to use its commands.

Keep in mind that free API's often have a limit and the Apex Tracker is not the exception. Do not spam the !stats command since the API will stop responding.

Deployment to Heroku

In order to deploy the bot to Heroku you need a free Heroku account and follow the next steps:

  • Go to your Heroku Dashboard and click on the New button located on the top-right corner.

  • Click on Create new app and then give it a name.

  • Select a Deployment Method. GitHub is the easiest one since you only need to provide your credentials. To deploy from GitHub you need to have a copy of the source code hosted there, so do that before selecting GitHub as deployment method.

Remember NOT to commit API credentials to public places. The .gitignore file should handle that already but make sure you're not doing it.

  • Set your API Credentials in Heroku as Environment Variables by clicking on the Settings tab and then adding them to the Config Vars section.
  • Go to the Resources tab on Heroku and click on the pencil icon to edit the Heroku Dyno.
  • Turn it on and click on Confirm. Once you do that everything should be ready.

Author

Josias Alvarado

Built With

Contributing

Contributions and issues are welcome!

Show your support

Give a ⭐️ if you like this project!

License

This project is MIT licensed.

Acknowledgements

About

A Discord bot that tells jokes, provides Apex Legends player stats, Today In History facts, and jokes to your inbox whenever mentioned.

License:MIT License


Languages

Language:Ruby 100.0%