From 643330f51a500de9c86892bebe8b180e17ee9b27 Mon Sep 17 00:00:00 2001 From: kmmiio99o <164557248+kmmiio99o@users.noreply.github.com> Date: Sat, 27 Sep 2025 21:46:14 +0200 Subject: [PATCH] Refactor konochan commands to use sendBotMessage API --- plugins/all-in-one/src/commands/konochan.ts | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/plugins/all-in-one/src/commands/konochan.ts b/plugins/all-in-one/src/commands/konochan.ts index eff21e0..d3e3aaa 100644 --- a/plugins/all-in-one/src/commands/konochan.ts +++ b/plugins/all-in-one/src/commands/konochan.ts @@ -1,7 +1,13 @@ import { findByProps } from "@vendetta/metro"; -import { sendMessage } from "../utils/messages"; import { alerts } from "@vendetta/ui"; +const MessageActions = findByProps("sendMessage"); +const messageUtil = findByProps( + "sendBotMessage", + "sendMessage", + "receiveMessage", +); + /** * Fetches a random image from KonoChan. * @param isNSFW - Whether to include NSFW content. @@ -68,22 +74,18 @@ export const konoSelfCommand = { const imageUrl = await fetchImage(isNSFW); if (!imageUrl) { - return sendMessage( + messageUtil.sendBotMessage( ctx.channel.id, "No image found. Try again later.", - undefined, - undefined, - true, ); + return { type: 4 }; } - return sendMessage( + messageUtil.sendBotMessage( ctx.channel.id, `Here's your random image: ${imageUrl}`, - undefined, - undefined, - true, ); + return { type: 4 }; }, applicationId: "-1", inputType: 1, @@ -110,10 +112,10 @@ export const konoSendCommand = { const imageUrl = await fetchImage(isNSFW); if (!imageUrl) { - return sendMessage(ctx.channel.id, "No image found. Try again later."); + return { type: 4, data: { content: "No image found. Try again later." } }; } - return sendMessage(ctx.channel.id, imageUrl); + return { type: 4, data: { content: imageUrl } }; }, applicationId: "-1", inputType: 1,