From 1ce453a13b37f8b4b42ab0b87e0cac242f3b9739 Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Sun, 18 Oct 2020 15:21:26 +0300 Subject: Update formatting of voice gate failing embed --- bot/exts/moderation/voice_gate.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/bot/exts/moderation/voice_gate.py b/bot/exts/moderation/voice_gate.py index 325331999..5516675d1 100644 --- a/bot/exts/moderation/voice_gate.py +++ b/bot/exts/moderation/voice_gate.py @@ -16,7 +16,9 @@ from bot.utils.checks import InWhitelistCheckFailure log = logging.getLogger(__name__) -FAILED_MESSAGE = """{user} you don't meet with our current requirements to pass Voice Gate. You {reasons}.""" +FAILED_MESSAGE = ( + """You are not currently eligible to use voice inside Python Discord for the following reasons:\n\n{reasons}""" +) MESSAGE_FIELD_MAP = { "verified_at": f"have been verified for less {GateConf.minimum_days_verified} days", @@ -88,14 +90,9 @@ class VoiceGate(Cog): [self.bot.stats.incr(f"voice_gate.failed.{key}") for key, value in checks.items() if value is True] if failed: - if len(failed_reasons) > 1: - reasons = f"{', '.join(failed_reasons[:-1])} and {failed_reasons[-1]}" - else: - reasons = failed_reasons[0] - embed = discord.Embed( title="Voice Gate not passed", - description=FAILED_MESSAGE.format(user=ctx.author.mention, reasons=reasons), + description=FAILED_MESSAGE.format(reasons="\n".join(f'- You {reason}.' for reason in failed_reasons)), color=Colour.red() ) await ctx.author.send(embed=embed) -- cgit v1.2.3