Initialize services
This commit is contained in:
@@ -17,8 +17,8 @@ var (
|
||||
UserService userService
|
||||
ChannelService channelService
|
||||
MessageService messageService
|
||||
PatreonService patreonService
|
||||
RequestService requestService
|
||||
PatreonService patreonService
|
||||
ServerService serverService
|
||||
)
|
||||
|
||||
@@ -52,4 +52,16 @@ func ConnectDatabase(dbConnString string) {
|
||||
log.Fatal(err)
|
||||
}
|
||||
log.Println("Migrations Run")
|
||||
initServices()
|
||||
log.Println("Services Initialized")
|
||||
}
|
||||
|
||||
func initServices() {
|
||||
GuildService = guildService{db: db}
|
||||
UserService = userService{db: db}
|
||||
ChannelService = channelService{db: db}
|
||||
MessageService = messageService{db: db}
|
||||
PatreonService = patreonService{db: db}
|
||||
RequestService = requestService{db: db}
|
||||
ServerService = serverService{db: db}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package exts
|
||||
|
||||
import (
|
||||
"github.com/dustinpianalto/disgoman"
|
||||
"github.com/dustinpianalto/geeksbot"
|
||||
"github.com/dustinpianalto/geeksbot/internal/exts/utils"
|
||||
)
|
||||
|
||||
func AddCommandHandlers(h *disgoman.CommandManager) {
|
||||
func AddCommandHandlers(g *geeksbot.Geeksbot) {
|
||||
// Arguments:
|
||||
// name - command name - string
|
||||
// desc - command description - string
|
||||
@@ -14,9 +14,9 @@ func AddCommandHandlers(h *disgoman.CommandManager) {
|
||||
// perms - permissisions required - anpan.Permission (int)
|
||||
// type - command type, sets where the command is available
|
||||
// run - function to run - func(anpan.Context, []string) / CommandRunFunc
|
||||
_ = h.AddCommand(utils.UserCommand)
|
||||
_ = h.AddCommand(utils.SayCommand)
|
||||
_ = h.AddCommand(utils.GitCommand)
|
||||
_ = h.AddCommand(utils.InviteCommand)
|
||||
_ = h.AddCommand(utils.PingCommand)
|
||||
_ = g.AddCommand(utils.UserCommand)
|
||||
_ = g.AddCommand(utils.SayCommand)
|
||||
_ = g.AddCommand(utils.GitCommand)
|
||||
_ = g.AddCommand(utils.InviteCommand)
|
||||
_ = g.AddCommand(utils.PingCommand)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user