Skip to content

add pagination #808

Open
Open
@github-actions

Description

@github-actions

# TODO: add pagination

        # find the top 10 snippets by uses
        snippets: list[Snippet] = await self.db.get_all_snippets_by_guild_id(ctx.guild.id)
        if not snippets:
            await self.send_snippet_error(ctx, description="No snippets found.")
            return
        snippets.sort(key=lambda x: x.uses, reverse=True)

        # Format the text
        text = "```\n"
        for i, snippet in enumerate(snippets[:10]):
            text += f"{i + 1}. {snippet.snippet_name.ljust(20)} | uses: {snippet.uses}\n"
        text += "```"

        # only show top 10, no pagination
        # TODO: add pagination
        embed = EmbedCreator.create_embed(
            embed_type=EmbedType.DEFAULT,
            title="Top Snippets",

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions