GitXplorerGitXplorer
o

mailbot

public
3 stars
0 forks
7 issues

Commits

List of commits on branch master.
Unverified
ed64ebac2b543b73db5e33d8831a6aae3e2fb429

Fix toplevel constant reference.

committed 5 years ago
Unverified
7204f104822d37d6decbc55b4cb97eafe8e4c843

Handle failed Newegg RSS parsing.

committed 5 years ago
Unverified
75b55cb45020d130cc3a9212510de055d4b96864

Update ruby version.

committed 5 years ago
Unverified
4462e652af2c1ed457cfa71147d8ffa79ce5225f

New Inspiro command class.

committed 6 years ago
Unverified
309b6c571eb35b82eca8421b3331a6f27b933e6f

Add an inspiro command.

committed 6 years ago
Unverified
93fe1fa7ec12b49812c67767a69513270d50ad43

Update readme build badge.

committed 6 years ago

README

The README file for this repository.

Build Status

Mailbot

A chat bot that works simultaneously in Twitch + Discord.

Introduction

Mailbot started as a 20-line Ruby script live-coded on Twitch as an example of how to work with sockets. You can watch the video here. Since then, it's slowly expanded to do random things when I can't find a good solution using other existing bots.

Mailbot is free to use under the terms of the license. If you don't want to spend the time setting up and deploying your own instance, there is a hosted instance with a web UI. However, it currently only supports Discord connections.

Dependencies

  • Ruby 2.x (tested on 2.5.1)
  • PostgreSQL (tested on 9.5)

Setup

  1. git clone
  2. bundle install
  3. cp config/database.yml.example config/database.yml and edit
  4. cp config/secrets.yml.example config/secrets.yml and edit
  5. Edit config/settings.yml and put in your bot account name
  6. rake db:create
  7. rake db:migrate
  8. bin/mailbot start

Note: The bot will not work without valid API tokens and client IDs for both Twitch and Discord. Check the developer documentation for both services.

Adding Commands

Commands are POROs (plain old Ruby classes) that inherit from Mailbot::Commands::Base and live in lib/mailbot/commands. They just need to implement the perform method which must return a string that will be the result of using the command in chat. After creating a class, add a require statement to lib/mailbot/commands.rb.

Adding Timers

Scheduled tasks consist of two parts. First, a subclass of Mailbot::Models::Job that implements the perform method. Second, a record in the database representing a particular instance of said job. Every five minutes, Mailbot::Scheduler will query for jobs and run any that are due. This Mailbot scheduler does not guarantee exact times, but only that a job will not run any sooner than the configured interval.

Support

Find me in Discord.

Contributing

Contributions are welcome. Make sure the tests pass (bundle exec rake spec).

License

The source code is available under the terms of the GPL v3 license.