diff options
| author | 2021-07-08 13:53:48 +0200 | |
|---|---|---|
| committer | 2021-07-08 23:44:04 +0200 | |
| commit | a8e30f6c67cd64a5cf5a1ab0b3668a06a9621485 (patch) | |
| tree | 6c29f29ca7ff6b6a27a9e020bc6d2443d92420d8 | |
| parent | Create `join_role_stats` function in helpers (diff) | |
Add `Leads` role(s) to the server information embed
| -rw-r--r-- | bot/exts/info/information.py | 7 | ||||
| -rw-r--r-- | bot/utils/helpers.py | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 1b1243118..677b5d1f7 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -17,8 +17,10 @@ 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.helpers import join_role_stats from bot.utils.time import humanize_delta, time_since + log = logging.getLogger(__name__) @@ -50,7 +52,10 @@ class Information(Cog): constants.Roles.owners, constants.Roles.contributors, ) ) - return {role.name.title(): len(role.members) for role in roles} + role_stats = {role.name.title(): len(role.members) for role in roles} + role_stats.update( + **join_role_stats([constants.Roles.project_leads, constants.Roles.domain_leads], "Leads", guild)) + return role_stats def get_extended_server_info(self, ctx: Context) -> str: """Return additional server info only visible in moderation channels.""" diff --git a/bot/utils/helpers.py b/bot/utils/helpers.py index 1da5da5a3..b0d17c3b8 100644 --- a/bot/utils/helpers.py +++ b/bot/utils/helpers.py @@ -1,6 +1,5 @@ from abc import ABCMeta -from types import List -from typing import Dict, Optional +from typing import Dict, List, Optional from discord import Guild from discord.ext.commands import CogMeta |