From 285b99ced8f7ed58ad1b4d2e81dd63cc0b7ca102 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Wed, 5 Feb 2025 22:26:37 -0700 Subject: [PATCH] chatsounds: surely i wont regret this --- src/modules/misc/chatsounds.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/modules/misc/chatsounds.js b/src/modules/misc/chatsounds.js index 5a75a07..003100b 100644 --- a/src/modules/misc/chatsounds.js +++ b/src/modules/misc/chatsounds.js @@ -1,4 +1,7 @@ const Command = require("#lib/command.js"); +const InteractionCommand = require("#lib/interactionCommand.js"); +const {ApplicationCommandOptionTypes} = require("#util/dconstants.js"); + const {default: Chatsounds, defaultModifiers} = require("sh"); const sh = new Chatsounds({modifiers: defaultModifiers, gitHubToken: hf.apikeys.github}); @@ -42,3 +45,19 @@ chatsounds.callback = async function (msg, line) { }; }; hf.registerCommand(chatsounds); + +const chatsoundsInteraction = new InteractionCommand("chatsounds"); +chatsoundsInteraction.helpText = "Garry's Mod chatsounds as a file output"; +chatsoundsInteraction.options.input = { + name: "input", + type: ApplicationCommandOptionTypes.STRING, + description: "Chatsounds to parse", + required: true, + default: "", +}; +chatsoundsInteraction.callback = async function (interaction) { + const input = this.getOption(interaction, "input"); + + return chatsounds.callback(interaction, input); +}; +hf.registerCommand(chatsoundsInteraction);