From bde85e073abff34683eaa60a687dbd1bc5c011d9 Mon Sep 17 00:00:00 2001 From: byron <47872200+byeoon@users.noreply.github.com> Date: Mon, 11 Mar 2024 12:55:39 -0400 Subject: [PATCH] added second command, also added to devs for simplicity not sure if i should YET tho --- src/userplugins/WebhookManager/index.ts | 29 +++++++++++++++++++++---- src/utils/constants.ts | 4 ++++ 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/userplugins/WebhookManager/index.ts b/src/userplugins/WebhookManager/index.ts index 893b33109..0b9e611c5 100644 --- a/src/userplugins/WebhookManager/index.ts +++ b/src/userplugins/WebhookManager/index.ts @@ -6,11 +6,12 @@ import definePlugin from "@utils/types"; import { ApplicationCommandInputType, ApplicationCommandOptionType, findOption, sendBotMessage, RequiredMessageOption } from "@api/Commands"; +import Devs from "utils/constants"; export default definePlugin({ name: "WebhookManager", description: "Manage your webhooks easily; delete, send messages, get detailed info and more.", - authors: [{ id: 1, name: "byron", },], // will change ID soon, not home + authors: [Devs.byron], dependencies: ["CommandsAPI"], commands: [ { @@ -19,12 +20,11 @@ export default definePlugin({ inputType: ApplicationCommandInputType.BUILT_IN, options: [ { - RequiredMessageOption, // will this work? will debug when home. + RequiredMessageOption, // will debug when home. name: "url", description: "The URL of the webhook.", - - type: ApplicationCommandOptionType.STRING, + execute: (opts, ctx) => { sendBotMessage(ctx.channel.id, { @@ -35,5 +35,26 @@ export default definePlugin({ } ], }, + { + name: "webhookinfo", + description: "Retrieve information about a webhook.", + inputType: ApplicationCommandInputType.BUILT_IN, + options: [ + { + RequiredMessageOption, + name: "url", + description: "The URL of the webhook.", + type: ApplicationCommandOptionType.STRING, + + execute: (opts, ctx) => { + + sendBotMessage(ctx.channel.id, { + content: "Hello world! \n " + + "This is a string addition and \n, testing." + }); + } + } + ], + } ] }); \ No newline at end of file diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 081eed34f..9d5e9b0b9 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -426,6 +426,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ Elvyra: { name: "Elvyra", id: 708275751816003615n, + }, + Byron: { + name: "byron", // am i even allowed to add this right now? + id: 639577344276692992n, } } satisfies Record);