added second command, also added to devs for simplicity not sure if i should YET tho

This commit is contained in:
byron 2024-03-11 12:55:39 -04:00 committed by GitHub
parent ccce4952cc
commit bde85e073a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 4 deletions

View file

@ -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."
});
}
}
],
}
]
});

View file

@ -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<string, Dev>);