@@ -1637,8 +1637,6 @@ async def contact(
1637
1637
async def blocked (self , ctx ):
1638
1638
"""Retrieve a list of blocked users."""
1639
1639
1640
- embeds = [discord .Embed (title = "Blocked Users" , color = self .bot .main_color , description = "" )]
1641
-
1642
1640
roles = []
1643
1641
users = []
1644
1642
now = ctx .message .created_at
@@ -1700,43 +1698,54 @@ async def blocked(self, ctx):
1700
1698
if role :
1701
1699
roles .append ((role .mention , reason ))
1702
1700
1701
+ user_embeds = [discord .Embed (title = "Blocked Users" , color = self .bot .main_color , description = "" )]
1702
+
1703
1703
if users :
1704
- embed = embeds [0 ]
1704
+ embed = user_embeds [0 ]
1705
1705
1706
1706
for mention , reason in users :
1707
1707
line = mention + f" - { reason or 'No Reason Provided' } \n "
1708
1708
if len (embed .description ) + len (line ) > 2048 :
1709
1709
embed = discord .Embed (
1710
- title = "Blocked Users (Continued) " ,
1710
+ title = "Blocked Users" ,
1711
1711
color = self .bot .main_color ,
1712
1712
description = line ,
1713
1713
)
1714
- embeds .append (embed )
1714
+ user_embeds .append (embed )
1715
1715
else :
1716
1716
embed .description += line
1717
1717
else :
1718
- embeds [0 ].description = "Currently there are no blocked users."
1718
+ user_embeds [0 ].description = "Currently there are no blocked users."
1719
+
1720
+ if len (user_embeds ) > 1 :
1721
+ for n , em in enumerate (user_embeds ):
1722
+ em .title = f'{ em .title } [{ n + 1 } ]'
1719
1723
1720
- embeds . append ( discord .Embed (title = "Blocked Roles" , color = self .bot .main_color , description = "" ))
1724
+ role_embeds = [ discord .Embed (title = "Blocked Roles" , color = self .bot .main_color , description = "" )]
1721
1725
1722
1726
if roles :
1723
- embed = embeds [- 1 ]
1727
+ embed = role_embeds [- 1 ]
1724
1728
1725
1729
for mention , reason in roles :
1726
1730
line = mention + f" - { reason or 'No Reason Provided' } \n "
1727
1731
if len (embed .description ) + len (line ) > 2048 :
1732
+ role_embeds [- 1 ].set_author ()
1728
1733
embed = discord .Embed (
1729
- title = "Blocked Roles (Continued) " ,
1734
+ title = "Blocked Roles" ,
1730
1735
color = self .bot .main_color ,
1731
1736
description = line ,
1732
1737
)
1733
- embeds .append (embed )
1738
+ role_embeds .append (embed )
1734
1739
else :
1735
1740
embed .description += line
1736
1741
else :
1737
- embeds [- 1 ].description = "Currently there are no blocked roles."
1742
+ role_embeds [- 1 ].description = "Currently there are no blocked roles."
1738
1743
1739
- session = EmbedPaginatorSession (ctx , * embeds )
1744
+ if len (role_embeds ) > 1 :
1745
+ for n , em in enumerate (role_embeds ):
1746
+ em .title = f'{ em .title } [{ n + 1 } ]'
1747
+
1748
+ session = EmbedPaginatorSession (ctx , * user_embeds , * role_embeds )
1740
1749
1741
1750
await session .run ()
1742
1751
0 commit comments