aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar kosayoda <[email protected]>2021-01-23 17:25:06 +0800
committerGravatar kosayoda <[email protected]>2021-01-23 17:51:43 +0800
commit8cdee214cca54ce1fdbfc98b38ce95c1ed5a3a0c (patch)
tree2ceed4f632a1899976eff0f65d23f9288ff0a8ec
parentUse helper function to determine mod channel. (diff)
Reduce unnecessary line splits and parameters.
-rw-r--r--bot/exts/info/information.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py
index e475d0b75..343942109 100644
--- a/bot/exts/info/information.py
+++ b/bot/exts/info/information.py
@@ -51,7 +51,7 @@ class Information(Cog):
)
return {role.name.title(): len(role.members) for role in roles}
- def get_extended_server_info(self, guild: Guild) -> str:
+ def get_extended_server_info(self) -> str:
"""Return additional server info only visible in moderation channels."""
talentpool_count = len(self.bot.get_cog("Talentpool").watched_users)
bb_count = len(self.bot.get_cog("Big Brother").watched_users)
@@ -136,10 +136,7 @@ class Information(Cog):
@command(name="server", aliases=["server_info", "guild", "guild_info"])
async def server_info(self, ctx: Context) -> None:
"""Returns an embed full of server information."""
- embed = Embed(
- colour=Colour.blurple(),
- title="Server Information",
- )
+ embed = Embed(colour=Colour.blurple(), title="Server Information")
created = time_since(ctx.guild.created_at, precision="days")
region = ctx.guild.region
@@ -164,7 +161,8 @@ class Information(Cog):
embed.description = textwrap.dedent(f"""
Created: {created}
- Voice region: {region}{features}
+ Voice region: {region}\
+ {features}
Roles: {num_roles}
Member status: {member_status}
""")
@@ -173,9 +171,7 @@ class Information(Cog):
# Members
total_members = ctx.guild.member_count
member_counts = self.get_member_counts(ctx.guild)
- member_info = "\n".join(
- f"{role}: {count}" for role, count in member_counts.items()
- )
+ member_info = "\n".join(f"{role}: {count}" for role, count in member_counts.items())
embed.add_field(name=f"Members: {total_members}", value=member_info)
# Channels
@@ -188,9 +184,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.guild)
- )
+ embed.add_field(name="Moderation:", value=self.get_extended_server_info())
await ctx.send(embed=embed)