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
)
func new() *DiscommandStruct {
discommand := DiscommandStruct{
var Discommand *DiscommandStruct
func init() {
Discommand = &DiscommandStruct{
Commands: map[string]*Command{},
Aliases: map[string]string{},
Components: []*Component{},
Modals: []*Modal{},
}
return &discommand
}
func (d *DiscommandStruct) LoadCommand(c *Command) {
@ -171,5 +172,3 @@ func (d *DiscommandStruct) ModalRun(s *discordgo.Session, i *discordgo.Interacti
break
}
}
var Discommand *DiscommandStruct = new()