diff --git a/index.js b/index.js index a91fe22..f120a7c 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,9 @@ const { ApplicationCommandTypes, InteractionTypes, ApplicationIntegrationTypes, - InteractionContextTypes + InteractionContextTypes, + MessageFlags, + ComponentTypes } = require("oceanic.js"); const client = new Client({ @@ -38,6 +40,12 @@ client.on("ready", () => { description: "...", type: ApplicationCommandOptionTypes.BOOLEAN, required: false + }, + { + name: "cv2", + description: "...", + type: ApplicationCommandOptionTypes.BOOLEAN, + required: false } ] } @@ -58,6 +66,18 @@ client.on("interactionCreate", async (interaction) => { if (interaction.data.type === ApplicationCommandTypes.CHAT_INPUT) { const content = interaction.data.options.getString("content", true); const raw = interaction.data.options.getBoolean("raw"); + const cv2Text = interaction.data.options.getBoolean("cv2"); + + if (cv2Text) + interaction.createFollowup({ + flags: MessageFlags.IS_UIKIT_COMPONENTS, + components: [ + { + type: ComponentTypes.TEXT, + content + } + ] + }); interaction.createFollowup( raw @@ -70,4 +90,10 @@ client.on("interactionCreate", async (interaction) => { } }); +process.on("uncaughtException", (e) => { + client.rest.channels.createMessage("1367826538665476236", { + content: "```\n" + e.stack || e.message + "\n```" + }); +}); + client.connect();