#Help

1 messages · Page 1 of 1 (latest)

balmy cape
#

How to make a discord bot send 25 different embed messages in 1 webhook using 1 slash command. The fact is that discord limits the ability to send 1 webhook to 10 messages.

solemn scaffold
#

Not possible to send that many in one message.

balmy cape
solemn scaffold
#

Yeah, it's still a "message" in the channel. You'd have to break it into multiple messages (embeds / 10 = no. of messages)

balmy cape
solemn scaffold
#

First thing..

solemn scaffold
#

but you'd need to split the large list of embeds into 3 smaller lists of [[10], [10], [4]]

#

You could use a pretty simple function to chunk them.

def chunk_embeds_by_limit(embeds, limit=10):
  return [embeds[i:i + limit] for i in range(0, len(embeds), limit)]

So,

embeds = []
...
...
chunked_embeds = chunk_embeds_by_limit(embeds)

for embeds in chunked_embeds:
    await webhook.send(embeds=embeds)

...
#

That would send multiple webhook messages each with no more than 10 embeds.