feat: information command componentsV2
This commit is contained in:
parent
b6ac950f2e
commit
35347edb85
1 changed files with 24 additions and 27 deletions
|
@ -2,7 +2,6 @@ package commands
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
|
||||||
|
|
||||||
"git.wh64.net/muffin/goMuffin/configs"
|
"git.wh64.net/muffin/goMuffin/configs"
|
||||||
"git.wh64.net/muffin/goMuffin/utils"
|
"git.wh64.net/muffin/goMuffin/utils"
|
||||||
|
@ -29,37 +28,35 @@ var InformationCommand *Command = &Command{
|
||||||
func informationRun(s *discordgo.Session, m any) {
|
func informationRun(s *discordgo.Session, m any) {
|
||||||
owner, _ := s.User(configs.Config.Bot.OwnerId)
|
owner, _ := s.User(configs.Config.Bot.OwnerId)
|
||||||
utils.NewMessageSender(m).
|
utils.NewMessageSender(m).
|
||||||
AddEmbeds(&discordgo.MessageEmbed{
|
AddComponents(discordgo.Container{
|
||||||
Title: fmt.Sprintf("%s의 정보", s.State.User.Username),
|
Components: []discordgo.MessageComponent{
|
||||||
Fields: []*discordgo.MessageEmbedField{
|
discordgo.Section{
|
||||||
{
|
Accessory: discordgo.Thumbnail{
|
||||||
Name: "운영 체제",
|
Media: discordgo.UnfurledMediaItem{
|
||||||
Value: utils.InlineCode(fmt.Sprintf("%s %s", runtime.GOARCH, runtime.GOOS)),
|
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),
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
discordgo.TextDisplay{
|
||||||
Name: "제작자",
|
Content: fmt.Sprintf("- **최근에 업데이트된 날짜**\n> %s", utils.Time(configs.UpdatedAt, utils.RelativeTime)),
|
||||||
Value: utils.InlineCode(owner.Username),
|
|
||||||
},
|
},
|
||||||
{
|
discordgo.TextDisplay{
|
||||||
Name: "버전",
|
Content: fmt.Sprintf("- **봇이 시작한 시각**\n> %s", utils.Time(configs.StartedAt, utils.RelativeTime)),
|
||||||
Value: utils.InlineCode(configs.MUFFIN_VERSION),
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
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).
|
SetReply(true).
|
||||||
Send()
|
Send()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue