From 35347edb85522a3946d092110c03ac8f5560841a Mon Sep 17 00:00:00 2001 From: Siwoo Jeon Date: Sat, 24 May 2025 14:33:28 +0900 Subject: [PATCH] feat: information command componentsV2 --- commands/information.go | 51 +++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/commands/information.go b/commands/information.go index b7cedee..9788875 100644 --- a/commands/information.go +++ b/commands/information.go @@ -2,7 +2,6 @@ package commands import ( "fmt" - "runtime" "git.wh64.net/muffin/goMuffin/configs" "git.wh64.net/muffin/goMuffin/utils" @@ -29,37 +28,35 @@ var InformationCommand *Command = &Command{ func informationRun(s *discordgo.Session, m any) { owner, _ := s.User(configs.Config.Bot.OwnerId) utils.NewMessageSender(m). - AddEmbeds(&discordgo.MessageEmbed{ - Title: fmt.Sprintf("%s의 정보", s.State.User.Username), - Fields: []*discordgo.MessageEmbedField{ - { - Name: "운영 체제", - Value: utils.InlineCode(fmt.Sprintf("%s %s", runtime.GOARCH, runtime.GOOS)), + AddComponents(discordgo.Container{ + Components: []discordgo.MessageComponent{ + discordgo.Section{ + Accessory: discordgo.Thumbnail{ + Media: discordgo.UnfurledMediaItem{ + URL: s.State.User.AvatarURL("512"), + }, + }, + Components: []discordgo.MessageComponent{ + discordgo.TextDisplay{ + Content: fmt.Sprintf("### %s의 정보", s.State.User.Username), + }, + discordgo.TextDisplay{ + Content: fmt.Sprintf("- **제작자**\n> %s", owner.Username), + }, + discordgo.TextDisplay{ + Content: fmt.Sprintf("- **버전**\n> %s", configs.MUFFIN_VERSION), + }, + }, }, - { - Name: "제작자", - Value: utils.InlineCode(owner.Username), + discordgo.TextDisplay{ + Content: fmt.Sprintf("- **최근에 업데이트된 날짜**\n> %s", utils.Time(configs.UpdatedAt, utils.RelativeTime)), }, - { - Name: "버전", - Value: utils.InlineCode(configs.MUFFIN_VERSION), + discordgo.TextDisplay{ + Content: fmt.Sprintf("- **봇이 시작한 시각**\n> %s", utils.Time(configs.StartedAt, utils.RelativeTime)), }, - { - Name: "최근에 업데이트된 날짜", - Value: utils.Time(configs.UpdatedAt, utils.RelativeTime), - Inline: true, - }, - { - Name: "시작한 시각", - Value: utils.Time(configs.StartedAt, utils.RelativeTime), - Inline: true, - }, - }, - Color: utils.EmbedDefault, - Thumbnail: &discordgo.MessageEmbedThumbnail{ - URL: s.State.User.AvatarURL("512"), }, }). + SetComponentsV2(true). SetReply(true). Send() }