From 7a5d7f46b6a26a0e35503665c22720c1ec65913d Mon Sep 17 00:00:00 2001 From: Lukas | AstroGD Date: Fri, 25 Nov 2022 16:55:27 +0100 Subject: [PATCH] cli command guild delete closes #3 --- src/cli/guild.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/cli/guild.ts b/src/cli/guild.ts index 9c98555..42c58db 100644 --- a/src/cli/guild.ts +++ b/src/cli/guild.ts @@ -124,6 +124,21 @@ export default async function execute(args: string[]) { break; } + case "delete": { + if (!args[1]) return printHelp(); + + await database.getRepository(GuildSetting).delete({ + id: args[1] + }); + + await database.getRepository(Badword).delete({ + guildID: args[1] + }); + + console.log(`Deleted all data for guild ${args[1]}`); + break; + } + default: { printHelp(); break; @@ -137,7 +152,8 @@ function printHelp() { guild info [GUILDID] guild setPremium [GUILDID] [YYYY-MM-DD or NULL] -guild words [get|add|remove|clear]`); +guild words [get|add|remove|clear] +guild delete [GUILDID]`); } function printWordHelp() {