Refactor message handling functions for improved clarity and maintainability
This commit is contained in:
@@ -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, {
|
||||
|
||||
@@ -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) {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user