Skip to content

Commit 7099e5b

Browse files
committed
Merge #298 with couple of minor changes
2 parents e4720ff + d550afe commit 7099e5b

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

utils/custom_help.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,25 @@ async def send_bot_help(self, mapping: dict[commands.Cog, list[commands.Command]
2727
}
2828
)
2929

30-
await self.get_destination().send(
31-
embed=discord.Embed.from_dict(
32-
{
33-
"color": self.color,
34-
"fields": cog_fields,
35-
"footer": {
36-
"text": "For more information on a command : !help [command]"
37-
},
38-
}
30+
## embeds can only have 25 fields
31+
## per https://docs.discord.com/developers/resources/message#embed-object
32+
embeds = []
33+
for i in range(0, len(cog_fields), 25):
34+
## create embeds for each slice of 25
35+
embeds.append(
36+
discord.Embed.from_dict(
37+
{
38+
"color": self.color,
39+
"fields": cog_fields[i:i+25],
40+
"footer": {
41+
"text": "For more information on a command : !help [command]"
42+
},
43+
}
44+
)
3945
)
40-
)
46+
47+
## send all embeds
48+
await self.get_destination().send(embeds=embeds)
4149

4250
async def send_command_help(self, command):
4351
"""Command help menu"""

0 commit comments

Comments
 (0)