Skip to content

Code snippet sharing — /snippet command #41

@BillChirico

Description

@BillChirico

Part of #40

A /snippet slash command for the community to save and share reusable code snippets. Like a community-owned GitHub Gist inside Discord.

Subtasks

  • Create snippets table: id, name (unique per guild), language, code, author_id, guild_id, usage_count, created_at, updated_at
  • /snippet save — modal or text input for name, language (autocomplete), and code block
  • /snippet get — return code in Discord code block with syntax highlighting, increment usage_count
  • /snippet search — fuzzy search via ILIKE or pg_trgm across name and code content
  • /snippet list — paginated embed showing recent and most-used snippets
  • /snippet delete — author or admin only
  • Autocomplete on snippet names for get/delete commands
  • Graceful fallback without DATABASE_URL — ephemeral reply saying feature requires DB

Acceptance Criteria

  • Users can save, retrieve, search, and delete snippets
  • Syntax highlighting works correctly
  • Usage tracking shows popular snippets

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions