From c65e5052b746a22db197600198fb5d84040e1acf Mon Sep 17 00:00:00 2001 From: Ibrahim Ansari Date: Mon, 23 Aug 2021 17:20:54 +0530 Subject: [PATCH] Add slashOptions to commands, port some commands. Current approach is to have slashGenerator and generator. --- src/commands/api.ts | 1 + src/commands/games.ts | 140 +++++++++++++++++++++++++++++++++++++++--- src/commands/tools.ts | 1 + src/imports/types.ts | 7 ++- src/index.ts | 53 ++++++++++++---- yarn.lock | 6 +- 6 files changed, 182 insertions(+), 26 deletions(-) diff --git a/src/commands/api.ts b/src/commands/api.ts index 73bf940..5d6d183 100644 --- a/src/commands/api.ts +++ b/src/commands/api.ts @@ -150,6 +150,7 @@ export const handleCat: Command = { example: '/cat', argsRequired: false }, + slashGenerator: true, generator: async () => { try { // Fetch a cat and process it (this sounds funny to me idk why) diff --git a/src/commands/games.ts b/src/commands/games.ts index c794a69..83c467a 100644 --- a/src/commands/games.ts +++ b/src/commands/games.ts @@ -1,3 +1,4 @@ +import { CommandOptionType } from 'slash-create' import { Command } from '../imports/types.js' import { evaluate } from 'mathjs' @@ -29,7 +30,17 @@ export const handleChoose: Command = { description: 'Choose between multiple options.', fullDescription: 'Choose between multiple options.', example: '/choose cake|ice cream|pasta', - usage: '/choose