update tests and remove old code block
This commit is contained in:
@@ -1,27 +1,6 @@
|
|||||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "@discordjs";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "@discordjs";
|
||||||
import { getPosts } from "@root/plugins/yandere/api/api.ts";
|
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 = [
|
export const commands = [
|
||||||
{
|
{
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|||||||
@@ -5,13 +5,19 @@ Deno.test("Empty Post Request", async() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
Deno.test("Post Request with tag", 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() => {
|
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() => {
|
Deno.test("Post Request with page", async() => {
|
||||||
console.debug(await getPosts("[page: 30)]"))
|
console.debug(await getPosts(
|
||||||
|
{page: "30"}
|
||||||
|
))
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user