1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-27 13:34:28 +00:00

Don't send more than 5 embeds at a time in the bot chat

This commit is contained in:
Steffo 2020-04-08 18:56:41 +02:00
parent d5e38ae29a
commit 8560f850eb
2 changed files with 7 additions and 3 deletions

View file

@ -69,12 +69,14 @@ class DiscordLazyPlayEvent(rc.Event):
await main_channel.send(rsd.escape(f"▶️ {user} ha aggiunto {len(added)} file _(lazy)_ alla coda:")) await main_channel.send(rsd.escape(f"▶️ {user} ha aggiunto {len(added)} file _(lazy)_ alla coda:"))
else: else:
await main_channel.send(rsd.escape(f"▶️ Aggiunt{'o' if len(added) == 1 else 'i'} {len(added)} file " await main_channel.send(rsd.escape(f"▶️ Aggiunt{'o' if len(added) == 1 else 'i'} {len(added)} file "
f"_(lazy)_ alla coda:")) f"[i](lazy)[/i] alla coda:"))
for ytd in added: for ytd in added[:5]:
embed: discord.Embed = ytd.embed() embed: discord.Embed = ytd.embed()
if force_color: if force_color:
embed._colour = discord.Colour(force_color) embed._colour = discord.Colour(force_color)
await main_channel.send(embed=embed) await main_channel.send(embed=embed)
if len(added) > 5:
await main_channel.send(f"e altri {len(added) - 5}!")
if len(too_long) > 0: if len(too_long) > 0:
if user: if user:

View file

@ -72,11 +72,13 @@ class DiscordPlayEvent(rc.Event):
else: else:
await main_channel.send(rsd.escape(f"▶️ Aggiunt{'o' if len(added) == 1 else 'i'} {len(added)} file alla" await main_channel.send(rsd.escape(f"▶️ Aggiunt{'o' if len(added) == 1 else 'i'} {len(added)} file alla"
f" coda:")) f" coda:"))
for ytd in added: for ytd in added[:5]:
embed: discord.Embed = ytd.embed() embed: discord.Embed = ytd.embed()
if force_color: if force_color:
embed._colour = discord.Colour(force_color) embed._colour = discord.Colour(force_color)
await main_channel.send(embed=embed) await main_channel.send(embed=embed)
if len(added) > 5:
await main_channel.send(f"e altri {len(added) - 5}!")
if len(too_long) > 0: if len(too_long) > 0:
if user: if user: