aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2021-03-16 10:48:52 +0100
committerGravatar GitHub <[email protected]>2021-03-16 10:48:52 +0100
commit76b3b5898dd4163d8bac6ff330209f27f437e3d6 (patch)
treed94e71ce9e1e5326f59410508413ee924852b721
parentMerge pull request #1465 from python-discord/gitattributes (diff)
parentInfo: 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.py3
-rw-r--r--bot/exts/moderation/defcon.py4
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:
"""