Quizbot

Quizbot Extension

Contents

Outgoing channel : "QUIZBOT_CHANNEL"

Description

Quizbot will ask questions and check answers

The extension runs on triggers so these will need adding for the bot to do anything. An example set of triggers for twitch chat can be seen in the image below.

example quzbot triggers

Triggers/Actions

Triggers and actions below are updated when the automatic document generation system is run and only contain triggers actions relating to this specific extension.

Table last updated: Wed, 12 Mar 2025 05:38:02 GMT

Triggers

name trigger description
quizbotQuizStarted trigger_QuizbotQuizStarted Quiz was started, restarted or a new question was asked
quizbotQuizStopped trigger_QuizbotQuizStopped Quiz was stopped
quizbotQuizTimeout trigger_QuizbotQuizTimeout Quiz Question timedout
quizbotIncorrectAnswer trigger_QuizbotIncorrectAnswer Someone provided an incorrec answer
quizbotCorrectAnswer trigger_QuizbotCorrectAnswer Someone answered the quiz question correctly

Actions

name trigger description
quizbotStartQuiz action_QuizbotStartQuiz Start, restart or skip current question
quizbotStopQuiz action_QuizbotStopQuiz Stop the Quiz
quizbotCheckAnswer action_QuizbotCheckAnswer Check if answer is correct (including chat tag, ie !answer

"Quizbot" Extension Details...

Runs a quizbot from a list of files to entertain your viewers.
Source:

Methods

SaveConfigToServer()

Saves our config to the server
Source:

SendSettingsWidgetSmall(tochannel)

Sends out out Small settings widget
Parameters:
Name Type Description
tochannel string
Source:

checkAnswer(userAnswer)

Checks an answer to the current question. Sends the triggers trigger_QuizbotIncorrectAnswer or trigger_QuizbotCorrectAnswer depending on the result
Parameters:
Name Type Description
userAnswer string
Source:

findtriggerByMessageType(messagetype)

Finds a trigger by messagetype
Parameters:
Name Type Description
messagetype string
Source:
Returns:
trigger

heartBeatCallback()

Sends out heartbeat messages so other extensions can see our status
Source:

initialise(app, host, port, heartbeat)

Starts the extension using the given data.
Parameters:
Name Type Description
app object:Express
host string
port number
heartbeat number
Source:

onDataCenterConnect(socket)

Called on socket connect
Parameters:
Name Type Description
socket object
Source:

onDataCenterDisconnect(reason)

CAlled on socket disconnect
Parameters:
Name Type Description
reason string
Source:

onDataCenterMessage(server_packet)

Called when a message is received
Parameters:
Name Type Description
server_packet object
Source:

quizTimeout()

sends trigger_QuizbotQuizTimeout when current question timer expires
Source:

quizTimerCallback()

When the timer for the current question expires this is called to start a new question
Source:

readQuizFile()

Reads the question/answer file for the quiz
Source:

sendQuizStarted()

Sends the trigger_QuizbotQuizStarted trigger on quiz start
Source:

startQuiz()

Starts the quiz running
Source:

stopQuiz()

Stops the quiz sends trigger_QuizbotQuizStopped
Source: