diff options
| author | 2021-03-16 10:48:52 +0100 | |
|---|---|---|
| committer | 2021-03-16 10:48:52 +0100 | |
| commit | 76b3b5898dd4163d8bac6ff330209f27f437e3d6 (patch) | |
| tree | d94e71ce9e1e5326f59410508413ee924852b721 | |
| parent | Merge pull request #1465 from python-discord/gitattributes (diff) | |
| parent | Info: account for defcon threshold being None (diff) | |
Merge pull request #1468 from python-discord/bug/info/bot-xk/defcon-threshold-none
Account for defcon threshold being None when displaying server info
| -rw-r--r-- | bot/exts/info/information.py | 3 | ||||
| -rw-r--r-- | bot/exts/moderation/defcon.py | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 92ddf0fbd..c54ca96bf 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -64,7 +64,8 @@ class Information(Cog): defcon_info = "" if cog := self.bot.get_cog("Defcon"): - defcon_info = f"Defcon threshold: {humanize_delta(cog.threshold)}\n" + threshold = humanize_delta(cog.threshold) if cog.threshold else "-" + defcon_info = f"Defcon threshold: {threshold}\n" verification = f"Verification level: {ctx.guild.verification_level.name}\n" diff --git a/bot/exts/moderation/defcon.py b/bot/exts/moderation/defcon.py index bd16289b9..bab95405c 100644 --- a/bot/exts/moderation/defcon.py +++ b/bot/exts/moderation/defcon.py @@ -157,9 +157,9 @@ class Defcon(Cog): await ctx.send(embed=embed) - @defcon_group.command(aliases=('t', 'd')) + @defcon_group.command(name="threshold", aliases=('t', 'd')) @has_any_role(*MODERATION_ROLES) - async def threshold( + async def threshold_command( self, ctx: Context, threshold: Union[DurationDelta, int], expiry: Optional[Expiry] = None ) -> None: """ |