@@ -143,6 +143,21 @@ async def snippet(self, ctx, *, name: str.lower = None):
143143 """
144144
145145 if name is not None :
146+ if name == "compact" :
147+ embeds = []
148+
149+ for i , names in enumerate (zip_longest (* (iter (sorted (self .bot .snippets )),) * 15 )):
150+ description = format_description (i , names )
151+ embed = discord .Embed (color = self .bot .main_color , description = description )
152+ embed .set_author (
153+ name = "Snippets" , icon_url = self .bot .get_guild_icon (guild = ctx .guild , size = 128 )
154+ )
155+ embeds .append (embed )
156+
157+ session = EmbedPaginatorSession (ctx , * embeds )
158+ await session .run ()
159+ return
160+
146161 snippet_name = self .bot ._resolve_snippet (name )
147162
148163 if snippet_name is None :
@@ -162,13 +177,14 @@ async def snippet(self, ctx, *, name: str.lower = None):
162177 embed .set_author (name = "Snippets" , icon_url = self .bot .get_guild_icon (guild = ctx .guild , size = 128 ))
163178 return await ctx .send (embed = embed )
164179
165- embeds = []
166-
167- for i , names in enumerate (zip_longest (* (iter (sorted (self .bot .snippets )),) * 15 )):
168- description = format_description (i , names )
169- embed = discord .Embed (color = self .bot .main_color , description = description )
180+ embeds = [discord .Embed (color = self .bot .main_color ) for _ in range ((len (self .bot .snippets ) // 10 ) + 1 )]
181+ for embed in embeds :
170182 embed .set_author (name = "Snippets" , icon_url = self .bot .get_guild_icon (guild = ctx .guild , size = 128 ))
171- embeds .append (embed )
183+
184+ for i , snippet in enumerate (sorted (self .bot .snippets .items ())):
185+ embeds [i // 10 ].add_field (
186+ name = snippet [0 ], value = return_or_truncate (snippet [1 ], 350 ), inline = False
187+ )
172188
173189 session = EmbedPaginatorSession (ctx , * embeds )
174190 await session .run ()
0 commit comments