Add log for new game
This commit is contained in:
parent
31e5148e74
commit
e0ecd63712
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { anonymizePhrase, convertToKey, spacePhrase } from "$/utils/game";
|
import { anonymizePhrase, convertToKey, spacePhrase } from "$/utils/game";
|
||||||
import { channelSchema } from "$/schemas/general";
|
import { channelSchema } from "$/schemas/general";
|
||||||
import { config, database } from "$/main";
|
import { config, database, log } from "$/main";
|
||||||
import { ServerRoute } from "@hapi/hapi";
|
import { ServerRoute } from "@hapi/hapi";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import boom from "@hapi/boom";
|
import boom from "@hapi/boom";
|
||||||
|
|
@ -31,6 +31,7 @@ const route: ServerRoute = {
|
||||||
let phrases = readFileSync(config.game.files[word_list] as string, `utf-8`).split(`\n`);
|
let phrases = readFileSync(config.game.files[word_list] as string, `utf-8`).split(`\n`);
|
||||||
let phrase = phrases[Math.floor(Math.random() * phrases.length)].trim();
|
let phrase = phrases[Math.floor(Math.random() * phrases.length)].trim();
|
||||||
|
|
||||||
|
log.info(`New game in ${channel} with answer: ${phrase}`);
|
||||||
|
|
||||||
let spaced = spacePhrase(phrase.toUpperCase());
|
let spaced = spacePhrase(phrase.toUpperCase());
|
||||||
let anonymized = anonymizePhrase(spaced);
|
let anonymized = anonymizePhrase(spaced);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue