[fix] Pagination of emotes

This commit is contained in:
Zeva Rose 2024-03-04 20:30:05 -07:00
parent c3bc03430e
commit f3b7fba57e

View file

@ -246,11 +246,11 @@ Tips will be used to pay server costs, and any excess will go to local animal sh
for emoji in emojis:
static += not emoji.animated
animated += emoji.animated
if len(current) >= 4000:
messages.append(current)
if len(current) >= 2000:
messages.append(current.strip())
current = ""
current += f"<{'a' if emoji.animated else ''}:{emoji.name}:{emoji.id}> "
messages.append(current)
messages.append(current.strip())
embeds = [
Embed(
title=f"{static} Static, {animated} Animated, {len(emojis)} Total",
@ -261,12 +261,12 @@ Tips will be used to pay server costs, and any excess will go to local animal sh
for message in messages[1:]:
embeds.append(Embed(description=message, color="#3498db"))
message = await ctx.send(embeds=embeds[:10])
for i in range(10, len(embeds), 10):
await message.reply(embeds=embeds[i : i + 10])
message = await ctx.send(embeds=embeds[:2])
for i in range(2, len(embeds), 2):
await message.reply(embeds=embeds[i : i + 2])
except Exception as e:
self.logger.error("Encountered error: {e}", exc_info=True)
self.logger.error(f"Encountered error: {e}", exc_info=True)
@slash_command(
name="roleinfo",