From d96ae87d86823a96d0389fb6adb5db939ce8f84e Mon Sep 17 00:00:00 2001 From: Siwoo Jeon Date: Thu, 3 Apr 2025 17:54:57 +0900 Subject: [PATCH] feat: Fix command description's prefix --- commands/dataLength.go | 3 ++- commands/deleteLearnedData.go | 10 +++++----- commands/help.go | 4 ++-- commands/information.go | 4 ++-- commands/learn.go | 6 +++--- commands/learnedDataList.go | 3 ++- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/commands/dataLength.go b/commands/dataLength.go index 83e0de0..433c3a3 100644 --- a/commands/dataLength.go +++ b/commands/dataLength.go @@ -5,6 +5,7 @@ import ( "fmt" "strconv" + "git.wh64.net/muffin/goMuffin/configs" "git.wh64.net/muffin/goMuffin/databases" "git.wh64.net/muffin/goMuffin/utils" "github.com/bwmarrin/discordgo" @@ -37,7 +38,7 @@ var DataLengthCommand *Command = &Command{ }, Aliases: []string{"학습데이터량", "데이터량", "학습량"}, DetailedDescription: &DetailedDescription{ - Usage: "머핀아 학습데이터량", + Usage: fmt.Sprintf("%s학습데이터량", configs.Config.Bot.Prefix), }, Category: Generals, MessageRun: func(ctx *MsgContext) { diff --git a/commands/deleteLearnedData.go b/commands/deleteLearnedData.go index 10f1279..8abadb9 100644 --- a/commands/deleteLearnedData.go +++ b/commands/deleteLearnedData.go @@ -3,9 +3,9 @@ package commands import ( "context" "fmt" - "strconv" "strings" + "git.wh64.net/muffin/goMuffin/configs" "git.wh64.net/muffin/goMuffin/databases" "git.wh64.net/muffin/goMuffin/utils" "github.com/bwmarrin/discordgo" @@ -27,8 +27,8 @@ var DeleteLearnedDataCommand *Command = &Command{ }, Aliases: []string{"잊어", "지워"}, DetailedDescription: &DetailedDescription{ - Usage: "머핀아 삭제 (삭제할 단어)", - Examples: []string{"머핀아 삭제 머핀"}, + Usage: fmt.Sprintf("%s삭제 (삭제할 단어)", configs.Config.Bot.Prefix), + Examples: []string{fmt.Sprintf("%s삭제 머핀", configs.Config.Bot.Prefix)}, }, Category: Chattings, MessageRun: func(ctx *MsgContext) { @@ -124,9 +124,9 @@ func deleteLearnedDataRun(c *Command, s *discordgo.Session, m any, args *[]strin options = append(options, discordgo.SelectMenuOption{ Label: fmt.Sprintf("%d번 지식", i+1), Description: data.Result, - Value: utils.DeleteLearnedData + data.Id.Hex() + `&No.` + strconv.Itoa(i+1), + Value: fmt.Sprintf("%s%s&No.%d", utils.DeleteLearnedData, data.Id.Hex(), i+1), }) - description += strconv.Itoa(i+1) + ". " + data.Result + "\n" + description += fmt.Sprintf("%d. %s\n", i+1, data.Result) } embed := &discordgo.MessageEmbed{ diff --git a/commands/help.go b/commands/help.go index f57f943..83b66ca 100644 --- a/commands/help.go +++ b/commands/help.go @@ -34,8 +34,8 @@ var HelpCommand *Command = &Command{ }, Aliases: []string{"도움", "명령어", "help"}, DetailedDescription: &DetailedDescription{ - Usage: "머핀아 도움말 [명령어]", - Examples: []string{"머핀아 도움말", "머핀아 도움말 배워"}, + Usage: fmt.Sprintf("%s도움말 [명령어]", configs.Config.Bot.Prefix), + Examples: []string{fmt.Sprintf("%s도움말", configs.Config.Bot.Prefix), fmt.Sprintf("%s도움말 배워", configs.Config.Bot.Prefix)}, }, Category: Generals, MessageRun: func(ctx *MsgContext) { diff --git a/commands/information.go b/commands/information.go index 452cda6..2edb0f9 100644 --- a/commands/information.go +++ b/commands/information.go @@ -12,10 +12,10 @@ import ( var InformationCommand *Command = &Command{ ApplicationCommand: &discordgo.ApplicationCommand{ Name: "정보", - Description: "머핀봇의 정보를 알ㄹ려줘요.", + Description: fmt.Sprintf("머핀봇의 정보를 알ㄹ려줘요."), }, DetailedDescription: &DetailedDescription{ - Usage: "머핀아 정보", + Usage: fmt.Sprintf("%s정보", configs.Config.Bot.Prefix), }, Category: Generals, MessageRun: func(ctx *MsgContext) { diff --git a/commands/learn.go b/commands/learn.go index 0317342..120e0b4 100644 --- a/commands/learn.go +++ b/commands/learn.go @@ -35,10 +35,10 @@ var LearnCommand *Command = &Command{ }, Aliases: []string{"공부"}, DetailedDescription: &DetailedDescription{ - Usage: "머핀아 배워 (등록할 단어) (대답)", + Usage: fmt.Sprintf("%s배워 (등록할 단어) (대답)", configs.Config.Bot.Prefix), Examples: []string{"머핀아 배워 안녕 안녕!", - "머핀아 배워 \"야 죽을래?\" \"아니요 ㅠㅠㅠ\"", - "머핀아 배워 미간은_누구야? 이봇의_개발자요", + fmt.Sprintf("%s배워 \"야 죽을래?\" \"아니요 ㅠㅠㅠ\"", configs.Config.Bot.Prefix), + fmt.Sprintf("%s배워 미간은_누구야? 이봇의_개발자요", configs.Config.Bot.Prefix), }, }, Category: Chattings, diff --git a/commands/learnedDataList.go b/commands/learnedDataList.go index e77f9d4..9dfda3a 100644 --- a/commands/learnedDataList.go +++ b/commands/learnedDataList.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" + "git.wh64.net/muffin/goMuffin/configs" "git.wh64.net/muffin/goMuffin/databases" "git.wh64.net/muffin/goMuffin/utils" "github.com/bwmarrin/discordgo" @@ -20,7 +21,7 @@ var LearnedDataListCommand *Command = &Command{ }, Aliases: []string{"list", "목록", "지식목록"}, DetailedDescription: &DetailedDescription{ - Usage: "머핀아 리스트", + Usage: fmt.Sprintf("%s리스트", configs.Config.Bot.Prefix), }, Category: Chattings, MessageRun: func(ctx *MsgContext) {