Skip to content

Conversation

@ysmreg
Copy link

@ysmreg ysmreg commented Jan 24, 2026

This pull request introduces a new "role panel" feature for server management in the Discord bot, allowing admins to create, list, add roles to, remove roles from, and delete role panels via the /rolepanel command. It adds the necessary command registration, handler logic, database models, and subcommand implementations to support interactive role management through Discord's UI.

The most important changes are:

Role Panel Feature Implementation:

  • Added a new rolepanel command under server management, with subcommands for creating, deleting, adding, removing, and listing role panels. This includes command registration in commands.go and handler mapping in registry.go. [1] [2] [3] [4] [5]
  • Implemented subcommand logic in separate files: create.go for panel creation, delete.go for deletion, add.go for adding roles, remove.go for removing roles, and list.go for listing all panels in a server. Each subcommand provides user feedback and interactive selection via Discord embeds and select menus. [1] [2] [3] [4] [5]

Database Model and Migration:

  • Added new GORM models RolePanel and RolePanelOption to represent panels and their selectable roles, and updated the database setup to auto-migrate these models. [1] [2]

These changes enable server admins to manage self-assignable roles through a user-friendly panel system, improving the bot's role management capabilities.

@ysmreg ysmreg requested a review from Copilot January 24, 2026 09:23
@ysmreg ysmreg requested a review from a team as a code owner January 24, 2026 09:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a role panel feature for Discord server management, allowing admins to create interactive role selection panels using Discord's select menu UI. Users can self-assign roles through these panels, improving the bot's role management capabilities.

Changes:

  • Added database models (RolePanel and RolePanelOption) with GORM auto-migration support for storing panel configurations
  • Implemented a RolePanelRepository with full CRUD operations for panels and their role options
  • Created a /rolepanel command with five subcommands (create, delete, add, remove, list) for panel administration
  • Developed message component handlers for interactive panel functionality, including role selection and administrative actions

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
src/internal/model/rolepanel.go Defines database models for role panels and their selectable role options
src/internal/db/db.go Adds new models to database auto-migration
src/internal/repository/rolepanel.go Implements repository pattern with CRUD operations for role panels
src/internal/bot/command/server_management/rolepanel.go Main command handler with subcommand routing
src/internal/bot/command/server_management/rolepanel/create.go Subcommand to create new role panels
src/internal/bot/command/server_management/rolepanel/delete.go Subcommand to delete existing panels
src/internal/bot/command/server_management/rolepanel/add.go Subcommand to add roles to panels
src/internal/bot/command/server_management/rolepanel/remove.go Subcommand to remove roles from panels
src/internal/bot/command/server_management/rolepanel/list.go Subcommand to list all panels in a server
src/internal/bot/messageComponent/rolepanel.go Handles interactive select menu interactions for role assignment and panel management
src/internal/bot/command/commands.go Registers the rolepanel command
src/internal/bot/command/registry.go Maps the rolepanel command to its handler
.gitignore Adds docker-compose.yaml to ignored files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ysmreg and others added 4 commits January 24, 2026 18:39
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: ysmreg <33682244+ysmreg@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: ysmreg <33682244+ysmreg@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: ysmreg <33682244+ysmreg@users.noreply.github.com>
@yuito-it
Copy link
Member

@ysmreg コパイロットに生成させているのだろうけど、

  • Overview
  • DB構成に変更はないか
  • 関連するIssue
    についてセクションを分けて記述してください。

Copy link
Member

@yuito-it yuito-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ロールパネルの情報をデータとして保存することは、可能な限りデータを保持しないという方針から容認しがたく、セレクトメニューのIDにrp-hogehogeのようにして処理するようにしてください。
TSの既存実装を参考にすることをお勧めします。

@yuito-it yuito-it added kind/feature 新機能のリクエスト priority/mid 優先度: 中 scope/rp ロールパネルに関するIssue labels Jan 24, 2026
@yuito-it yuito-it linked an issue Jan 27, 2026 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature 新機能のリクエスト priority/mid 優先度: 中 scope/rp ロールパネルに関するIssue

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[v9] ロールパネル機能

3 participants