From c74c635ce0b06c08c199974b887125ceb26aa52f Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Sun, 3 Sep 2023 11:49:29 -0600 Subject: [PATCH] Add the ability for Nightbot to end a game through the command (mod only) --- docs/nightbot/index.html | 5 +++++ src/endpoints/nightbot.ts | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/docs/nightbot/index.html b/docs/nightbot/index.html index 1d5fc7d..a9b02db 100644 --- a/docs/nightbot/index.html +++ b/docs/nightbot/index.html @@ -13,6 +13,11 @@

Starts a new game of Chatman in the channel.

+ +

!chatman end (Mod-Only)

+

+ Stops the current game of Chatman in the channel. +


!chatman show

diff --git a/src/endpoints/nightbot.ts b/src/endpoints/nightbot.ts index 80c49c6..6fac591 100644 --- a/src/endpoints/nightbot.ts +++ b/src/endpoints/nightbot.ts @@ -33,6 +33,15 @@ const subcommands: {[index: string]: subcommand} = { })).payload; }, }, + "end": { + modOnly: true, + async handler(meta, req) { + return (await req.server.inject({ + method: `DELETE`, + url: `/${meta.channel}/game` + })).payload; + }, + }, "show": { modOnly: false, async handler(meta, req) {