Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over 50 roles displays as >>>> Displayin [50/50] Roles in /serverinfo #96

Closed
AllanTaylor314 opened this issue Jan 18, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working priority: low This has a low priority

Comments

@AllanTaylor314
Copy link

AllanTaylor314 commented Jan 18, 2024

Describe the bug
For a server with more than 50 roles, /serverinfo will claim there are exactly 50 roles (and there's a typo)

To Reproduce

  1. Create 72 roles (or really 51 or more)
  2. Call /serverinfo

Expected behavior
List of roles ends with >>>> Displaying [50/72] Roles

Screenshots
I don't have a server with that many roles

Template Version
6.1.0

Additional context
Proposed fix (the index hashes are possibly wrong since it's from a template copy)

diff --git a/cogs/general.py b/cogs/general.py
index 59af594..762613b 100644
--- a/cogs/general.py
+++ b/cogs/general.py
@@ -129,9 +129,10 @@ class General(commands.Cog, name="general"):
         :param context: The hybrid command context.
         """
         roles = [role.name for role in context.guild.roles]
-        if len(roles) > 50:
+        num_roles = len(roles)
+        if num_roles > 50:
             roles = roles[:50]
-            roles.append(f">>>> Displayin [50/{len(roles)}] Roles")
+            roles.append(f">>>> Displaying [50/{num_roles}] Roles")
         roles = ", ".join(roles)
 
         embed = discord.Embed(
@kkrypt0nn kkrypt0nn self-assigned this Jan 29, 2024
@kkrypt0nn kkrypt0nn added bug Something isn't working priority: low This has a low priority labels Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: low This has a low priority
Projects
None yet
Development

No branches or pull requests

2 participants