aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar D0rs4n <[email protected]>2021-08-02 20:42:56 +0200
committerGravatar D0rs4n <[email protected]>2021-08-02 20:42:56 +0200
commit8bb2ffc4f7bb324c7940fb88ae1b698f56f8ce67 (patch)
tree43c2788101351b7f877b36d40c1e1ab371ee5f0f
parentOptimize Information Cog's join_role_stats and get_member counts (diff)
Improve code consistency of join_role_stats and NonExistentRoleError
-rw-r--r--bot/errors.py2
-rw-r--r--bot/exts/info/information.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/bot/errors.py b/bot/errors.py
index 5209997f9..5785faa44 100644
--- a/bot/errors.py
+++ b/bot/errors.py
@@ -45,7 +45,7 @@ class BrandingMisconfiguration(RuntimeError):
class NonExistentRoleError(ValueError):
"""
- Raised by the Information Cog when encountering a role that does not exist.
+ Raised by the Information Cog when encountering a Role that does not exist.
Attributes:
`role_id` -- the ID of the role that does not exist
diff --git a/bot/exts/info/information.py b/bot/exts/info/information.py
index 2621e15b1..b879e1330 100644
--- a/bot/exts/info/information.py
+++ b/bot/exts/info/information.py
@@ -45,7 +45,7 @@ class Information(Cog):
@staticmethod
def join_role_stats(role_ids: list[int], guild: Guild, name: Optional[str] = None) -> dict[str, int]:
"""Return a dictionary with the number of `members` of each role given, and the `name` for this joined group."""
- members = int()
+ members = 0
for role_id in role_ids:
if (role := guild.get_role(role_id)) is not None:
members += len(role.members)