chore: use init
This commit is contained in:
parent
797bd56b3d
commit
20c0debf4a
1 changed files with 4 additions and 5 deletions
|
@ -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()
|
|
||||||
|
|
Loading…
Reference in a new issue