feat(discord-bot): add quete command
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m29s
All checks were successful
Build and Push Docker Image / build (push) Successful in 1m29s
This commit is contained in:
@@ -5,6 +5,7 @@ import { tejtrackCommand } from "./tejtrack";
|
|||||||
import { iconeCommand } from "./icone";
|
import { iconeCommand } from "./icone";
|
||||||
import { gemmesCommand } from "./gemmes";
|
import { gemmesCommand } from "./gemmes";
|
||||||
import { resultCommand } from "./result";
|
import { resultCommand } from "./result";
|
||||||
|
import { queteCommand } from "./quete";
|
||||||
|
|
||||||
export type Command = (
|
export type Command = (
|
||||||
message: OmitPartialGroupDMChannel<Message<boolean>>,
|
message: OmitPartialGroupDMChannel<Message<boolean>>,
|
||||||
@@ -18,4 +19,5 @@ export const commands: Record<string, Command> = {
|
|||||||
icone: iconeCommand,
|
icone: iconeCommand,
|
||||||
gemmes: gemmesCommand,
|
gemmes: gemmesCommand,
|
||||||
result: resultCommand,
|
result: resultCommand,
|
||||||
|
quete: queteCommand,
|
||||||
};
|
};
|
||||||
|
|||||||
20
apps/discord-bot/src/commands/quete.ts
Normal file
20
apps/discord-bot/src/commands/quete.ts
Normal file
@@ -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),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user