Skip to content

Conversation

@ibuki-hum4
Copy link
Member

help追加

#215

@ibuki-hum4 ibuki-hum4 marked this pull request as ready for review January 28, 2026 11:31
@ibuki-hum4 ibuki-hum4 requested a review from a team as a code owner January 28, 2026 11:31
Copilot AI review requested due to automatic review settings January 28, 2026 11:31
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.

LGTM!
と言いたいのですが...一点だけ。
jsonで処理するのは型の観点から好ましくないと考えており、constでファイルに定義していただけるとありがたいです。

@yuito-it yuito-it review requested due to automatic review settings January 28, 2026 11:34
@yuito-it yuito-it linked an issue Jan 28, 2026 that may be closed by this pull request
1 task
@yuito-it yuito-it added this to the v9 - Go Edition milestone Jan 28, 2026
@github-project-automation github-project-automation bot moved this from Untouched to In Progress in UniBot Feature Relase Jan 28, 2026
@yuito-it yuito-it added the kind/feature 新機能のリクエスト label Jan 28, 2026
@yuito-it yuito-it assigned yuito-it and ibuki-hum4 and unassigned yuito-it Jan 28, 2026
@yuito-it yuito-it changed the title Ibuki hum4/help command [v9] ヘルプコマンドの実装 Jan 28, 2026
Copilot AI review requested due to automatic review settings January 28, 2026 12:17
@ibuki-hum4 ibuki-hum4 requested a review from a team as a code owner January 28, 2026 12:17
@ibuki-hum4 ibuki-hum4 requested review from sibapybot and removed request for a team January 28, 2026 12:17
@ibuki-hum4
Copy link
Member Author

helpディレクトリにgit addしてなかったのでしばしお待ちを...

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 PR implements a help command for the Discord bot that displays information about available commands. The implementation allows users to view all commands or get detailed information about a specific command.

Changes:

  • Added /help command with optional parameter to view specific command details
  • Created JSON data file containing help information for all bot commands
  • Registered the help command in the command registry and handler map
  • Fixed a formatting issue in docker-compose.prod.yaml (unrelated cleanup)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/internal/bot/command/registry.go Registers the new help command handler
src/internal/bot/command/general/help/commands.json Contains help text and usage information for all commands
src/internal/bot/command/general/help.go Implements the help command handler with JSON loading and embed generation
src/internal/bot/command/commands.go Adds help command to the application command list
_docker-compose.prod.yaml Fixes formatting issue (extra dash removed)

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


// 特定のコマンドが指定された場合
if specificCommand != "" {
title = "Help - " + specificCommand + " コマンド"
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The "Skip" choice references "/skip" as a standalone command, but skip is actually a subcommand of tts (accessible via /tts skip). This mismatch will cause the help lookup to fail when users select this option, as there is no matching entry with the name "/skip" at the expected level in commands.json.

Suggested change
title = "Help - " + specificCommand + " コマンド"
Value: "/tts skip",

Copilot uses AI. Check for mistakes.
Comment on lines +84 to +87

// Usage が設定されている場合は表示
if cmd.Usage != "" {
fields = append(fields, &discordgo.MessageEmbedField{
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

Potential nil pointer dereference. When i.Member is nil (which can happen in DM contexts), the code falls back to i.User. However, later in the code (lines 151-157), it directly accesses user.Username and user.AvatarURL(""). If i.Member is nil in guild contexts (which shouldn't happen but could in edge cases), this would work but be inconsistent. The established pattern in the codebase is to assume i.Member is always available and use i.Member.DisplayName() and i.Member.AvatarURL("") directly without null checks. See src/internal/bot/command/general/about.go:59 and src/internal/bot/command/general/ping.go:34-40 for consistent patterns.

Copilot uses AI. Check for mistakes.
Comment on lines +14 to +15
Description: "利用可能なコマンドの一覧を表示します",
Options: []*discordgo.ApplicationCommandOption{
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The Title and Description fields in the helpCommandData struct are never used or populated by the commands.json file. The JSON file only contains a "fields" array, but these struct fields expect top-level "title" and "description" properties that don't exist in the JSON. These unused fields should either be removed from the struct or the JSON should be updated to include them.

Suggested change
Description: "利用可能なコマンドの一覧を表示します",
Options: []*discordgo.ApplicationCommandOption{
Title string `json:"-"`
Description string `json:"-"`

Copilot uses AI. Check for mistakes.
@ibuki-hum4 ibuki-hum4 requested a review from yuito-it January 28, 2026 12:21
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature 新機能のリクエスト

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[v9] help

3 participants