hqtrivia

A small framework for building HQ Trivia and HQ Words bots.

Installation

Add this to your application's shard.yml:

dependencies:
  hqtrivia:
    github: taylorfinnell/hqtrivia

Usage

require "hqtrivia"
class WordFrequencyBot
  include HqTrivia::Bot

  getter words
  @words = {} of String => Int32

  def handle_message(message : HqTrivia::Model::Interaction)
    message.metadata.message.split(/\s/).each do |word|
      @words[word.downcase] ||= 0
      @words[word.downcase] +=  1
    end
  end
end

coordinator = HqTrivia::HqCoordinator.new("us")
HqTrivia.on_show(coordinator) do |show|
  bot = WordFrequencyBot.new(coordinator)

  bot.play
end

HQ Trivia Messages

HQ Words Messages

HQ Heart Messages

Shared Messages

Contributors