From 0e7bb55c468c6fe527f6bbd92c6817f45727c37f Mon Sep 17 00:00:00 2001 From: kmmiio99o <164557248+kmmiio99o@users.noreply.github.com> Date: Sat, 27 Sep 2025 20:17:07 +0200 Subject: [PATCH] Restrict NSFW content to NSFW channels in KonoChan commands --- plugins/all-in-one/src/commands/konochan.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/all-in-one/src/commands/konochan.ts b/plugins/all-in-one/src/commands/konochan.ts index 43adf6f..200ecb0 100644 --- a/plugins/all-in-one/src/commands/konochan.ts +++ b/plugins/all-in-one/src/commands/konochan.ts @@ -47,6 +47,14 @@ export const konoSelfCommand = { const options = new Map(args.map((option: any) => [option.name, option])); const isNSFW = options.get("nsfw")?.value || false; + // Check if channel is NSFW for NSFW content + if (isNSFW && !ctx.channel.nsfw) { + return sendMessage( + ctx.channel.id, + "❌ NSFW content can only be sent in NSFW channels!", + ); + } + const imageUrl = await fetchImage(isNSFW); if (!imageUrl) { @@ -64,17 +72,18 @@ export const konoSendCommand = { name: "konosend", displayName: "konosend", description: "Fetch a random image from KonoChan and send it to the channel.", - displayDescription: "Fetch a random image from KonoChan and send it to the channel.", + displayDescription: + "Fetch a random image from KonoChan and send it to the channel.", options: [nsfwOption], execute: async (args: any, ctx: any) => { const options = new Map(args.map((option: any) => [option.name, option])); const isNSFW = options.get("nsfw")?.value || false; - // Check if NSFW images are allowed in the channel + // Check if channel is NSFW for NSFW content if (isNSFW && !ctx.channel.nsfw) { return sendMessage( ctx.channel.id, - "This channel is not marked as NSFW. Use an NSFW channel instead." + "❌ NSFW content can only be sent in NSFW channels!", ); }