Skip to content

Commit 71d1a80

Browse files
Merge main into msl-auth
2 parents 1cbedd6 + d013e60 commit 71d1a80

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

cogs/committee_actions_tracking.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import contextlib
44
import logging
55
import random
6+
import textwrap
67
from enum import Enum
78
from typing import TYPE_CHECKING
89

@@ -629,6 +630,17 @@ async def list_user_actions( # NOTE: Committee role check is not present becaus
629630
}"
630631
)
631632

633+
if len(actions_message) >= 2000:
634+
chunk: str
635+
for chunk in textwrap.wrap(
636+
text=actions_message,
637+
width=1950,
638+
break_long_words=False,
639+
fix_sentence_endings=True,
640+
):
641+
await ctx.respond(content=chunk)
642+
return
643+
632644
await ctx.respond(content=actions_message)
633645

634646
@committee_actions.command(
@@ -808,6 +820,19 @@ async def list_all_actions(
808820
],
809821
)
810822

823+
if len(all_actions_message) >= 2000:
824+
chunk: str
825+
for chunk in all_actions_message.split("\n\n"):
826+
sub_chunk: str
827+
for sub_chunk in textwrap.wrap(
828+
text=chunk,
829+
width=1950,
830+
break_long_words=False,
831+
fix_sentence_endings=True,
832+
):
833+
await ctx.respond(content=sub_chunk)
834+
return
835+
811836
await ctx.respond(content=all_actions_message)
812837

813838
@committee_actions.command(

0 commit comments

Comments
 (0)