-
Notifications
You must be signed in to change notification settings - Fork 0
Projectsにあるロールパネル機能の実装 #223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/go
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
/rolepanelcommand 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: ysmreg <33682244+ysmreg@users.noreply.github.com>
|
@ysmreg コパイロットに生成させているのだろうけど、
|
There was a problem hiding this 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の既存実装を参考にすることをお勧めします。
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
/rolepanelcommand. 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:
rolepanelcommand under server management, with subcommands for creating, deleting, adding, removing, and listing role panels. This includes command registration incommands.goand handler mapping inregistry.go. [1] [2] [3] [4] [5]create.gofor panel creation,delete.gofor deletion,add.gofor adding roles,remove.gofor removing roles, andlist.gofor 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:
RolePanelandRolePanelOptionto 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.