Skip to content

Commit

Permalink
Add old view as option with "compact"
Browse files Browse the repository at this point in the history
  • Loading branch information
sebkuip committed May 23, 2024
1 parent 51d8885 commit 16a4ecc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cogs/modmail.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ async def snippet(self, ctx, *, name: str.lower = None):
"""

if name is not None:
if name == "compact":
embeds = []

for i, names in enumerate(zip_longest(*(iter(sorted(self.bot.snippets)),) * 15)):
description = format_description(i, names)
embed = discord.Embed(color=self.bot.main_color, description=description)
embed.set_author(name="Snippets", icon_url=self.bot.get_guild_icon(guild=ctx.guild, size=128))
embeds.append(embed)

session = EmbedPaginatorSession(ctx, *embeds)
await session.run()
return

snippet_name = self.bot._resolve_snippet(name)

if snippet_name is None:
Expand Down

0 comments on commit 16a4ecc

Please sign in to comment.