Refactor message handling functions for improved clarity and maintainability

This commit is contained in:
fzzin
2025-04-14 19:43:27 +02:00
parent 212f6f60b0
commit 59803fabd5
6 changed files with 155 additions and 131 deletions

View File

@@ -4,7 +4,7 @@ import { logMessage } from "@root/logging.ts";
import { defaultString } from "@root/defaultString.ts";
import { Embed } from "@root/structures/embeds.ts";
export async function rule34MessageHandler(bot: Bot, message: Message) {
export async function rule34MessageHandler(message: Message) {
const command = message.content.trim().split(" ").slice(1).join(" ");
if (command === "drop") {
bot.helpers.sendMessage(message.channelId, {

View File

@@ -2,7 +2,7 @@ import { Bot, DiscordEmbed, Message} from "@discordeno";
import { logMessage } from "@root/logging.ts";
import { getPosts } from "@root/plugins/yandere/api/api.ts";
export async function yandereMessageHandler(bot: Bot, message: Message) {
export async function yandereMessageHandler(message: Message) {
const command = message.content.split(" ").slice(1).join(" ");
const args = command.match(/(\[.+\])/g)
if (command === "drop") {
@@ -21,4 +21,4 @@ export async function yandereMessageHandler(bot: Bot, message: Message) {
});
}
}
}
}