npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

hubot-loaded-questions

v2.2.5

Published

Play Loaded Questions, the game where guessing the answers gets you in just as much trouble as giving your own.

Downloads

14

Readme

hubot-loaded-questions

Play Loaded Questions, the game where guessing the answers gets you in just as much trouble as giving your own.

The Game

Loosely based on the hit board game by Freshly Completed, http://freshlycompleted.blogspot.com/2013/11/loaded-questions-free-printable-game.html

A typical game of Loaded Questions follows these steps:

  • Someone types !loadquestion in the Loaded Questions room.
[hubot APP] *NEW ROUND STARTED!!!*

The current question is: *"If you could add one feature to your cell phone, what would it be?"*
You can submit your own answer by sending me a private message beginning with `submit answer`, followed by your answer
  • Anyone who wants to play sends a PM to Hubot in the format submit answer HERE IS WHERE MY ANSWER GOES!
  • Once enough people have submitted answers, a countdown begins to end the round. The default is 5 players for quorum and a 5 minute countdown; see Configuration below. Or, someone can say !endquestion to end the round early.
  • When the round ends, Hubot will say:
[hubot APP] *ROUND ENDED!!!* (due to timeout)

There were 6 answers submitted for _"If you could add one feature to your cell phone, what would it be?"_:
> *1.* a pez dispenser
> *2.* send scheduled text messages to my parents
> *3.* A "receive call" feature would be sweet. :(
> *4.* lead into gold
> *5.* a spray bottle
> *6.* curing diseases for a nominal fee (paid directly to me)


Players whose answers haven't been guessed: *user2*, *user1*, *user6*, *user4*, *user5*, *user3*.
To guess who submitted an answer, say `!guessanswer [number] [username]`.
  • Users can then optionally guess who submitted each answer by saying !guessanswer or !ga followed by their guess.
  • As each answer is guessed, Hubot will let you know if you guessed correctly or incorrectly.
  • You can re-print the answers list to see which answers have been guessed so far (or because the list has scrolled way off the screen) by saying !printanswers.
  • Once all the answers are guessed, Hubot will wait patiently for the next round!

After playing for a while, you can see stats for the game by saying !lqstats, or stats for individual players by saying !lqstats [username].

Configuration

Loaded Questions has these configurable values:

  • HUBOT_LOADED_QUESTIONS_ROOM - which channel name or ID to post messages to (this game can be a little spammy, so it's best to have a dedicated room). By default, Hubot will save the ID of the room that it first hears !loadquestion in.
  • HUBOT_LOADED_QUESTIONS_QUORUM - how many answers to wait for before triggering a countdown to end the round. Default is 5.
  • HUBOT_LOADED_QUESTIONS_SKIPNUM - how many users must agree to skip a question before it is skipped. Default is 2.
  • HUBOT_LOADED_QUESTIONS_TIMEOUT - how many minutes to wait during the countdown before the round ends. Default is 5.
  • HUBOT_INCLUDE_RANDOM_ANSWER - whether or not to include a random answer from last round as hubot's answer. Default is true, but you'll need to play a full round (get through all the questions!) before these start showing up.

Loaded Questions comes with a default set of 300 questions. More can be added by creating a loaded_questions.json file in the res/ directory at the root of your Hubot project. This allows you to add those questions your friends keep asking you to add. Here's an example of what that might look like:

// hubot/res/loaded_questions.json
[
    "Ding dong! Who's there?",
    "Doctors hate him! What did he do?",
    {
      "question": "What's your {{}}?",
      "data": ["password", "social security number", "mother's maiden name"]
    }
]

Loaded Questions will find those extra questions and add 'em to the mix! Hubot will ask each question once at random, then shuffle the full list again.

Note that strange-lookin' question object in there. Those {{}}s signify a bit of randomness in the question. The question will still only be asked once per round, but it will be asked with a random choice from the data array to fill in the {{}} in the question. You can see several more examples of questions with this random feature in hubot-loaded-questions' res/base_questions.json file.

Commands

  • !loadquestion - (public only) starts a new question, if there isn't one currently.
  • !printquestion - (public or pm) prints the current question.
  • !skipquestion - (public only) votes to skips the current question and load a new one.
  • !endquestion - (public only) ends the round of questioning and displays the answers.
  • !printanswers - (public or pm) prints the answers that were given during the round.
  • !guessanswer [number] [user] - (public only) guess that answer number was submitted by user. You can shortcut this command with !ga [number] [user].
  • submit answer [answer] - (pm only) submits your answer to the question.
  • !lqstats [username] - (public or pm) shows some stats about the game. Optionally include a username to see stats for that specific user.

Uses hubot brain to keep track of the game state and some stats.

Add it to your hubot!

Run the following command

$ npm install hubot-loaded-questions --save

Then add hubot-loaded-questions to the external-scripts.json file (you may need to create this file).

["hubot-loaded-questions"]

Issues

If you find a bug, please let me know about it at https://github.com/perrygoy/hubot-loaded-questions/issues. This module was only tested on Discord and Slack, so I'm not sure how it behaves on other chat clients.


I've had a ton of fun creating this module and playing it with my friends, and i want it to be a great time for everyone. Thanks for taking the time to read this README, and i hope you have a great time playing Loaded Questions!