aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mbaruh <[email protected]>2021-02-17 18:30:27 +0200
committerGravatar mbaruh <[email protected]>2021-02-17 18:30:27 +0200
commite4c77617d38e18fd00e6a58a4ce81d85181c1d90 (patch)
tree6bfd25f2c223bf36f112d8fb734d6d9dd42e7a6f
parentRenamed _defcon_action to _update_threshold and updated docstring (diff)
Changed server command to work with new defcon cog
-rw-r--r--bot/exts/info/information.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py
index 4499e4c25..577ec13f0 100644
--- a/bot/exts/info/information.py
+++ b/bot/exts/info/information.py
@@ -17,7 +17,7 @@ from bot.decorators import in_whitelist
from bot.pagination import LinePaginator
from bot.utils.channel import is_mod_channel, is_staff_channel
from bot.utils.checks import cooldown_with_role_bypass, has_no_roles_check, in_whitelist_check
-from bot.utils.time import time_since
+from bot.utils.time import humanize_delta, time_since
log = logging.getLogger(__name__)
@@ -52,7 +52,7 @@ class Information(Cog):
)
return {role.name.title(): len(role.members) for role in roles}
- def get_extended_server_info(self) -> str:
+ def get_extended_server_info(self, ctx: Context) -> str:
"""Return additional server info only visible in moderation channels."""
talentpool_info = ""
if cog := self.bot.get_cog("Talentpool"):
@@ -64,9 +64,9 @@ class Information(Cog):
defcon_info = ""
if cog := self.bot.get_cog("Defcon"):
- defcon_status = "Enabled" if cog.enabled else "Disabled"
- defcon_days = cog.days.days if cog.enabled else "-"
- defcon_info = f"Defcon status: {defcon_status}\nDefcon days: {defcon_days}\n"
+ defcon_info = f"Defcon threshold: {humanize_delta(cog.threshold)}\n"
+
+ verification = f"Verification level: {ctx.guild.verification_level.name}\n"
python_general = self.bot.get_channel(constants.Channels.python_general)
@@ -74,6 +74,7 @@ class Information(Cog):
{talentpool_info}\
{bb_info}\
{defcon_info}\
+ {verification}\
{python_general.mention} cooldown: {python_general.slowmode_delay}s
""")
@@ -198,7 +199,7 @@ class Information(Cog):
# Additional info if ran in moderation channels
if is_mod_channel(ctx.channel):
- embed.add_field(name="Moderation:", value=self.get_extended_server_info())
+ embed.add_field(name="Moderation:", value=self.get_extended_server_info(ctx))
await ctx.send(embed=embed)