update tests and remove old code block

This commit is contained in:
fzzinchemical
2025-04-15 17:18:22 +02:00
parent 8df50c8c8f
commit c32b80e87b
4 changed files with 9 additions and 24 deletions

View File

@@ -1,27 +1,6 @@
import { ChatInputCommandInteraction, SlashCommandBuilder } from "@discordjs";
import { getPosts } from "@root/plugins/yandere/api/api.ts";
// export async function yandereMessageHandler(message: Message) {
// const command = message.content.split(" ").slice(1).join(" ");
// const args = command.match(/(\[.+\])/g)
// if (command === "drop") {
// const embed: DiscordEmbed | undefined = (await getPosts("[limit: 1]"))[0]
// if (embed === undefined) throw Error("undefined embed")
// bot.helpers.sendMessage(message.channelId, {
// embeds: [embed]
// })
// } else if (command.startsWith("drop [") && command.endsWith("]")) {
// logMessage(message);
// if (args === null) throw Error("args is null")
// const generatedEmbeds = await getPosts(args[0]);
// for (const embed of generatedEmbeds) {
// bot.helpers.sendMessage(message.channelId, {
// embeds: [embed],
// });
// }
// }
// }
export const commands = [
{
data: new SlashCommandBuilder()

View File

@@ -5,13 +5,19 @@ Deno.test("Empty Post Request", async() => {
})
Deno.test("Post Request with tag", async() => {
console.debug(await getPosts("[tags:love_live!_(series)]"))
console.debug(await getPosts(
{tags: "love_live!_(series)"}
))
})
Deno.test("Post Request with limit", async() => {
console.debug(await getPosts("[limit: 1)]"))
console.debug(await getPosts({
limit: "1"
}))
})
Deno.test("Post Request with page", async() => {
console.debug(await getPosts("[page: 30)]"))
console.debug(await getPosts(
{page: "30"}
))
})