fix: correct regex pattern for command argument matching in yandereMessageHandler

This commit is contained in:
fzzinchemical
2025-04-10 18:47:52 +02:00
parent 485432ce48
commit aedda260ec

View File

@@ -5,7 +5,7 @@ import { getPosts } from "@root/plugins/yandere/api/api.ts";
export async function yandereMessageHandler(bot: Bot, message: Message) { export async function yandereMessageHandler(bot: Bot, message: Message) {
const command = message.content.split(" ").slice(1).join(" "); const command = message.content.split(" ").slice(1).join(" ");
const args = command.match(/(\[\.+\])/g) const args = command.match(/(\[.+\])/g)
if (command === "drop") { if (command === "drop") {
const embed = (await getPosts("[limit: 1]"))[0] const embed = (await getPosts("[limit: 1]"))[0]
if (embed === undefined) throw Error("undefined embed") if (embed === undefined) throw Error("undefined embed")