aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ChrisJL <[email protected]>2021-11-27 23:12:38 +0000
committerGravatar GitHub <[email protected]>2021-11-27 23:12:38 +0000
commit00c1eb8b4ff6af030c1e160b2d2cbc61e33e351a (patch)
tree8abfece86508e3c1809ba7dd05534e12ab05e089
parentSuppress NotFound error when cleaning messages (diff)
parentChange placeholder for invalid rules message shortening (diff)
Merge pull request #1980 from python-discord/bsoyka/rules-bug
Limit the length of the invalid rule indices message
-rw-r--r--bot/exts/info/site.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/exts/info/site.py b/bot/exts/info/site.py
index e8e71558b..bcb04c909 100644
--- a/bot/exts/info/site.py
+++ b/bot/exts/info/site.py
@@ -1,3 +1,5 @@
+from textwrap import shorten
+
from discord import Colour, Embed
from discord.ext.commands import Cog, Context, Greedy, group
@@ -123,7 +125,8 @@ class Site(Cog):
# Remove duplicates and sort the rule indices
rules = sorted(set(rules))
- invalid = ', '.join(str(index) for index in rules if index < 1 or index > len(full_rules))
+ invalid = shorten(', '.join(str(index) for index in rules if index
+ < 1 or index > len(full_rules)), 50, placeholder='...')
if invalid:
await ctx.send(f":x: Invalid rule indices: {invalid}")