From 20c0debf4af3d7903b480f662589f115ba7b91af Mon Sep 17 00:00:00 2001 From: Siwoo Jeon Date: Sun, 18 May 2025 15:02:51 +0900 Subject: [PATCH] chore: use init --- commands/discommand.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/commands/discommand.go b/commands/discommand.go index ff23b12..ea9998a 100644 --- a/commands/discommand.go +++ b/commands/discommand.go @@ -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()