Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/taylorfinnell/hqtrivia
Framework for creating HQ Trivia bots
https://github.com/taylorfinnell/hqtrivia
crystal hq hq-trivia hq-trivia-bot hq-words
Last synced: 11 days ago
JSON representation
Framework for creating HQ Trivia bots
- Host: GitHub
- URL: https://github.com/taylorfinnell/hqtrivia
- Owner: taylorfinnell
- License: mit
- Created: 2018-05-02T21:54:03.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-13T05:01:08.000Z (over 3 years ago)
- Last Synced: 2024-10-25T02:04:40.546Z (about 2 months ago)
- Topics: crystal, hq, hq-trivia, hq-trivia-bot, hq-words
- Language: Crystal
- Size: 442 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hqtrivia
A small framework for building HQ Trivia and HQ Words bots.
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
hqtrivia:
github: taylorfinnell/hqtrivia
```## Usage
```crystal
require "hqtrivia"
``````crystal
class WordFrequencyBot
include HqTrivia::Botgetter words
@words = {} of String => Int32def handle_message(message : HqTrivia::Model::Interaction)
message.metadata.message.split(/\s/).each do |word|
@words[word.downcase] ||= 0
@words[word.downcase] += 1
end
end
endcoordinator = HqTrivia::HqCoordinator.new("us")
HqTrivia.on_show(coordinator) do |show|
bot = WordFrequencyBot.new(coordinator)bot.play
end
```**HQ Trivia Messages**
- `HqTriva::Model::Question`
- `HqTriva::Model::QuestionSummary`
- `HqTriva::Model::QuestionFinished`
- `HqTriva::Model::GameSummary`
- `HqTriva::Model::SurveyQuestion`
- `HqTriva::Model::SurveyResults`
- `HqTriva::Model::Checkpoint`
- `HqTriva::Model::CheckpointSummary`**HQ Words Messages**
- `HqTriva::Model::ShowWheel`
- `HqTriva::Model::HideWheel`
- `HqTriva::Model::StartRound`
- `HqTriva::Model::EndRound`
- `HqTriva::Model::WordsGameResult`**HQ Heart Messages**
- `HeartEpisodeWinners`
- `HeartFinalistIntro`
- `HeartFinalistUploadStatus`
- `HeartFinalistUploadUpdate`
- `HeartFinalistVote`
- `HeartFinalistWalkthrough`
- `HeartPhotoResults`
- `HeartPhotoUpload`
- `HeartPhotoVote`**Shared Messages**
- `HqTriva::Model::QuestionClosed`
- `HqTriva::Model::PostGame`
- `HqTriva::Model::Interaction`
- `HqTriva::Model::UnknownMessage`
- `HqTriva::Model::BroadcastStats`
- `HqTriva::Model::BroadcastEnded`
- `HqTriva::Model::Kicked`## Contributors
- [taylorfinnell](https://github.com/taylorfinnell) Taylor Finnell - creator, maintainer