From a68cfefe3dd63d891dff858b27ed66cb68606cf2 Mon Sep 17 00:00:00 2001 From: JJ-8 <34778827+JJ-8@users.noreply.github.com> Date: Tue, 12 Nov 2024 20:32:42 +0100 Subject: [PATCH] Add random emoji to solve message in Discord --- api/src/discord/agile/commands/solveTask.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/src/discord/agile/commands/solveTask.ts b/api/src/discord/agile/commands/solveTask.ts index d7502bd7..8de94d5f 100644 --- a/api/src/discord/agile/commands/solveTask.ts +++ b/api/src/discord/agile/commands/solveTask.ts @@ -32,11 +32,15 @@ export async function handleTaskSolved( await moveChannel(guild, task, null, ChannelMovingEvent.SOLVED); - return sendMessageToTask( + const message = await sendMessageToTask( guild, id, `${task.title} is solved by ${await convertToUsernameFormat(userId)}!` ); + + const emojis = ["🎉", "🎊", "🥳", "👏", "🔥", "🚀", "💪"]; + + message?.react(emojis[Math.floor(Math.random() * emojis.length)].toString()); } async function solveTaskLogic(client: Client, interaction: CommandInteraction) {