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
|
||||
)
|
||||
|
||||
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()
|
||||
|
|
Loading…
Reference in a new issue