fix guild prefix getter function
@@ -33,7 +33,12 @@ func InitCommandHandler(s *discordgo.Session, cfg *config.Config, db database.Da
UseDefaultHelpCommand: false,
OnError: errorHandler,
- GuildPrefixGetter: db.GetGuildPrefix,
+ GuildPrefixGetter: func(guildID string) (prefix string, err error) {
+ if prefix, err = db.GetGuildPrefix(guildID); database.IsErrDatabaseNotFound(err) {
+ err = nil
+ }
+ return
+ },
})
cmdHandler.SetObject("db", db)
