From 6a96772c251d89583184c915cc601ffcbfcba7ac Mon Sep 17 00:00:00 2001 From: smyalygames Date: Wed, 1 Mar 2023 14:16:00 +0000 Subject: [PATCH] feat(arabot): add check so there can only be one leader of a group --- src/commands/outreach/outreach.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands/outreach/outreach.ts b/src/commands/outreach/outreach.ts index 6d46d09..767a646 100644 --- a/src/commands/outreach/outreach.ts +++ b/src/commands/outreach/outreach.ts @@ -271,6 +271,11 @@ export class OutreachCommand extends Subcommand { await interaction.deferReply({ ephemeral: true }); + if (await getStatFromLeader(leader.id) !== null) { + await interaction.editReply(`${leader} is already a leader for another group!`); + return; + } + const event = await getCurrentEvent(); if (event === null) {