Move the answers into the config instead of the code
This commit is contained in:
parent
d5e0b32adf
commit
84e8dd9aa2
3 changed files with 9 additions and 2 deletions
|
|
@ -1,3 +1,7 @@
|
|||
[quiz]
|
||||
answers = []
|
||||
|
||||
|
||||
[twitch]
|
||||
|
||||
[twitch.auth]
|
||||
|
|
@ -8,6 +12,7 @@ username = ""
|
|||
command_prefix = "!"
|
||||
channels = []
|
||||
|
||||
|
||||
[discord]
|
||||
|
||||
[discord.webhook]
|
||||
|
|
|
|||
|
|
@ -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 = {};
|
||||
|
|
|
|||
3
src/types/config.d.ts
vendored
3
src/types/config.d.ts
vendored
|
|
@ -1,4 +1,7 @@
|
|||
interface config {
|
||||
quiz: {
|
||||
answers: string[];
|
||||
};
|
||||
twitch: {
|
||||
auth: {
|
||||
oauth_token: string;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue