Skip to content

joshleblanc/YuelaBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintainability Test Coverage

Open in Gitpod

Quick Start

Click the gitpod button above to launch into a pre-configured cloud IDE. All you have to do is setup your bot token in .env, then run bundle exec ruby main.rb

Prerequisites

  • Ruby
  • Postgres*

* You can change the database driver in ./config/database.yml if you so desire. You'll need to include the associated gem in the Gemfile as well.

Installation instructions

bundle install will install the dependencies for the project

rake db:create will create the database

rake db:migrate will run the database migrations

How to run

There needs to be a file called config in the config directory. This file is functionally a .env file, with the following keys:

discord=<Your discord api key>
google=<A google api key>
search_id=<The search engine id for your custom search engine>
reddit_secret=<Reddit secret for .. reddit>
reddit_clientid=<Reddit api client id>
reddit_user=<Your reddit username>
reddit_pass=<Your reddit password>
admins=<A comma delimited list of discord user ids, who can do administration tasks on the bot>
open_weather_key=<An open weather map api key>
wordnik_key=<API key for wordnik>
github_access_token=<Access token for github, for submitting issues>

Once the file is there, you can run the bot with:

bundle exec foreman start

Debugging

You can pause executation at any line by calling byebug.

You can read byebug's documentation here: https://github.com/deivid-rodriguez/byebug

Basically it pauses executation and drops you in a console in the execution context for you to play around in

Support me

Buy Me A Coffee