chore: use init

This commit is contained in:
Siwoo Jeon 2025-05-18 15:02:51 +09:00
parent 797bd56b3d
commit 20c0debf4a
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA

View file

@ -80,14 +80,15 @@ var (
modalMutex sync.Mutex modalMutex sync.Mutex
) )
func new() *DiscommandStruct { var Discommand *DiscommandStruct
discommand := DiscommandStruct{
func init() {
Discommand = &DiscommandStruct{
Commands: map[string]*Command{}, Commands: map[string]*Command{},
Aliases: map[string]string{}, Aliases: map[string]string{},
Components: []*Component{}, Components: []*Component{},
Modals: []*Modal{}, Modals: []*Modal{},
} }
return &discommand
} }
func (d *DiscommandStruct) LoadCommand(c *Command) { func (d *DiscommandStruct) LoadCommand(c *Command) {
@ -171,5 +172,3 @@ func (d *DiscommandStruct) ModalRun(s *discordgo.Session, i *discordgo.Interacti
break break
} }
} }
var Discommand *DiscommandStruct = new()