diff options
author | 2022-11-27 14:51:18 +0000 | |
---|---|---|
committer | 2022-11-27 15:17:50 +0000 | |
commit | 7900bce46ad8028f16575f81a76ddc9a53a14c8c (patch) | |
tree | 97578830dd6962a9f5c59fc82beed86c59f3daa1 | |
parent | Typehint bot.get_cog calls in information cog (diff) |
Fetch active nominations from the API for !server command
The nomination cache was recently removed, so accessing that no longer works.
-rw-r--r-- | bot/exts/info/information.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py index 24e12a313..c680da2bc 100644 --- a/bot/exts/info/information.py +++ b/bot/exts/info/information.py @@ -81,12 +81,12 @@ class Information(Cog): ) return role_stats - def get_extended_server_info(self, ctx: Context) -> str: + async def get_extended_server_info(self, ctx: Context) -> str: """Return additional server info only visible in moderation channels.""" talentpool_info = "" talentpool_cog: TalentPool | None = self.bot.get_cog("Talentpool") if talentpool_cog: - num_nominated = len(talentpool_cog.cache) if talentpool_cog.cache else "-" + num_nominated = len(await talentpool_cog.api.get_nominations(active=True)) talentpool_info = f"Nominated: {num_nominated}\n" bb_info = "" @@ -232,7 +232,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(ctx)) + embed.add_field(name="Moderation:", value=await self.get_extended_server_info(ctx)) await ctx.send(embed=embed) |