Giter Site home page Giter Site logo

justatrivialbot / triviabotdevelopment Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 73 KB

Reddit Trivia Bot development version

License: GNU General Public License v3.0

JavaScript 81.51% CSS 3.88% HTML 14.61%
reddit snoowrap nodejs bot trivia mysql

triviabotdevelopment's Introduction

Just a Trivial Bot

Reddit Trivia Bot development version

I've never used Node before and wanted to make a trivia bot. This is a test version that will be very broken and probably only accessible to me.

Hopefully the bot will be able to:

  • set up time-delimited trivia quizzes restricted by subreddit
  • send lists of randomized questions to players
  • receive answers and score them
  • post scores and answers at the end of the specified time period.

Update Dec 23 2018

The bot can now pull private messages containing a specific JSON array into a mysql database, including metadata and questions.

JSON array is as follows:

{
	"Subreddit": "TrivialBotHQ",
	"Start": "2019-01-03T00:00",
	"End": "2019-01-13T00:00",
	"HomePost": "aba3do",
	"Type": "FFA",
	"Randomize": "N",
	"ScoreViz": "Players",
	"Scoring": "Timed",
	"TPQ": "5",
	"TimeDeduction": "1",
	"questions" : [{
		"Type": "FITB",
		"Text": "Answer Foo",
		"Correct": "Foo",
		"PV": "20",
		"qNo": ""
	},{
		"Type": "TF",
		"Text": "Answer true",
		"Correct": "true",
		"PV": "20",
		"qNo": ""
	},{
		"Type": "MC",
		"Text": "Answer Blue",
		"Correct": "Blue",
		"Incorrect": "red,green,yellow",
		"PV": "20",
		"qNo": ""
	},{
		"Type": "FITB",
		"Text": "What is the capital of Assyria?",
		"Correct": "Assur",
		"PV": "20",
		"qNo": ""
	},{
		"Type": "TF",
		"Text": "Answer false",
		"Correct": "false",
		"PV": "20",
		"qNo": ""
	}]
}

Array explained

  • ID is Null by default on a new quiz. You will receive a message back with the ID so you can make subsequent edits.
  • Subreddit is self explanatory, no /r/ required
  • Start and End dates in MYSQL format
  • Scoring can be FLAT or TIMED. Default FLAT.
  • TPQ is time per question in minutes. Default 5 minutes. Can be skipped.
  • Time deduction is points deducted per minute for exceeding TPQ.
  • Type is game type, Free for All or Bracket. Default FFA.
  • HomePost is the hex ID of the post that you want the bot talking in. Can be omitted.
  • Randomize is whether or not you want the questions randomized per player to prevent cheating. Default Y.
  • Questions are a nested array.
  • Type can be FITB, TF or MC (Fill in the Blank, True/False, Multiple Choice.) Default FITB.
  • Text is the question you want to ask.
  • Correct is the correct answer.
  • Incorrect are the wrong answers for MC questions only.
  • PV is point value.

There's a JSON Generator here.

To do

  • Get the bot's karma up so it can send private messages w/o captcha
  • Send confirmations to quiz admins on quiz creation.
  • Check that generated JSON is proced properly.
  • Edit Quiz method and post format.
  • Meta commands: Pause, Resume, Edit, Transfer, Scores, Abort.
  • Send quizzes to players.
  • Score player responses.
  • Permissions for !Scores command.
  • Prevent multiple attempts at the same quiz from same player.
  • Post new quizzes to the bot's home subreddit so that trivia fans can find them.
  • Install a throttle for new quizzes so we don't hit rate limit.
  • Bracket pairing.
  • JSON generator.
  • Allow quiz admin to edit their quiz after it creation, e.g. adding HomePost id.
  • Methods for bot to report all scores at the end of a quiz.
  • Survey mode? Maybe. Possibly too far out of scope. Yup too far out of scope.

If you would like to help out, message /u/JustATrivialBot on Reddit. Tx!

triviabotdevelopment's People

Contributors

justatrivialbot avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.