File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 33import contextlib
44import logging
55import random
6+ import textwrap
67from enum import Enum
78from 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 (
You can’t perform that action at this time.
0 commit comments