Skip to content

Commit 6cbee1f

Browse files
Fix error in user count calculation
Updated the user count calculation to handle cases where `member_count` is None by defaulting to 0. This prevents potential errors when summing member counts across guilds.
1 parent 209aa6f commit 6cbee1f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bronxbot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def update_stats(self):
7878
try:
7979
stats = {
8080
'server_count': len(self.guilds),
81-
'user_count': sum(g.member_count for g in self.guilds),
81+
'user_count': sum((g.member_count or 0) for g in self.guilds),
8282
'uptime': int(time.time() - self.start_time),
8383
'latency': round(self.latency * 1000, 2),
8484
'guilds': [str(g.id) for g in self.guilds],

0 commit comments

Comments
 (0)