From 84e8dd9aa27766f739c28a73414de6ea64bcf678 Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 12 Dec 2021 15:53:09 -0600 Subject: [PATCH] Move the answers into the config instead of the code --- config.template.toml | 5 +++++ src/main.ts | 3 +-- src/types/config.d.ts | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/config.template.toml b/config.template.toml index dbb76c4..edb7845 100644 --- a/config.template.toml +++ b/config.template.toml @@ -1,3 +1,7 @@ +[quiz] +answers = [] + + [twitch] [twitch.auth] @@ -8,6 +12,7 @@ username = "" command_prefix = "!" channels = [] + [discord] [discord.webhook] diff --git a/src/main.ts b/src/main.ts index 6182679..3b22436 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,6 @@ import { Client } from "tmi.js"; import { readFileSync } from "fs"; import { Logger } from "tslog"; -import * as tmi from "tmi.js"; const toml = require("toml"); var log = new Logger({ @@ -32,7 +31,7 @@ export function reset_users() { export var question_index = -1; export var user_answers = {}; export var user_right_count = {}; -export const correct_answers = []; +export const correct_answers = config.quiz.answers; export var commands = {}; diff --git a/src/types/config.d.ts b/src/types/config.d.ts index d9cef6f..b0d3d0f 100644 --- a/src/types/config.d.ts +++ b/src/types/config.d.ts @@ -1,4 +1,7 @@ interface config { + quiz: { + answers: string[]; + }; twitch: { auth: { oauth_token: string;