diff --git a/apps/discord-bot/src/commands/index.ts b/apps/discord-bot/src/commands/index.ts index 2eb8e67..d4c8fc5 100644 --- a/apps/discord-bot/src/commands/index.ts +++ b/apps/discord-bot/src/commands/index.ts @@ -5,6 +5,7 @@ import { tejtrackCommand } from "./tejtrack"; import { iconeCommand } from "./icone"; import { gemmesCommand } from "./gemmes"; import { resultCommand } from "./result"; +import { queteCommand } from "./quete"; export type Command = ( message: OmitPartialGroupDMChannel>, @@ -18,4 +19,5 @@ export const commands: Record = { icone: iconeCommand, gemmes: gemmesCommand, result: resultCommand, + quete: queteCommand, }; diff --git a/apps/discord-bot/src/commands/quete.ts b/apps/discord-bot/src/commands/quete.ts new file mode 100644 index 0000000..50d9e71 --- /dev/null +++ b/apps/discord-bot/src/commands/quete.ts @@ -0,0 +1,20 @@ +import { EmbedBuilder } from "discord.js"; +import type { Command } from "~/commands"; +import { getLatestQuest } from "~/services/wov"; + +export const queteCommand: Command = async (message) => { + const quest = await getLatestQuest(); + const color = parseInt(quest.quest.promoImagePrimaryColor.substring(1), 16); + + await message.reply({ + allowedMentions: { + repliedUser: false + }, + embeds: [ + new EmbedBuilder() + .setTitle("QuĂȘte actuelle") + .setImage(quest.quest.promoImageUrl) + .setColor(color), + ], + }); +};