diff --git a/config/global.go b/config/global.go index 1de6aff..58de5cc 100644 --- a/config/global.go +++ b/config/global.go @@ -5,8 +5,7 @@ const ( ) const ( - BotNamePaguMainnet = "Pagu-Mainnet" - BotNamePaguStaging = "Pagu-Staging" + BotNamePaguMainnet = "Pagu" BotNamePaguTestnet = "Pagu-Testnet" BotNamePaguModerator = "Pagu-Moderator" ) diff --git a/internal/platforms/discord/discord.go b/internal/platforms/discord/discord.go index ae387d6..7858cf4 100644 --- a/internal/platforms/discord/discord.go +++ b/internal/platforms/discord/discord.go @@ -88,8 +88,7 @@ func (bot *Bot) registerCommands() error { } switch bot.target { - case config.BotNamePaguMainnet, - config.BotNamePaguStaging: + case config.BotNamePaguMainnet: if !utils.IsFlagSet(cmd.TargetFlag, command.TargetMaskMainnet) { continue } @@ -103,6 +102,10 @@ func (bot *Bot) registerCommands() error { if !utils.IsFlagSet(cmd.TargetFlag, command.TargetMaskModerator) { continue } + + default: + log.Warn("invalid target", "target", bot.target) + continue } log.Info("registering new command", "name", cmd.Name, "desc", cmd.Help, "index", i, "object", cmd) @@ -130,6 +133,10 @@ func (bot *Bot) registerCommands() error { if !utils.IsFlagSet(subCmd.TargetFlag, command.TargetMaskModerator) { continue } + + default: + log.Warn("invalid target", "target", bot.target) + continue } log.Info("adding sub-command", "command", cmd.Name, diff --git a/internal/platforms/telegram/telegram.go b/internal/platforms/telegram/telegram.go index a1e4a19..facc1e9 100644 --- a/internal/platforms/telegram/telegram.go +++ b/internal/platforms/telegram/telegram.go @@ -109,6 +109,15 @@ func (bot *Bot) registerCommands() error { if !utils.IsFlagSet(beCmd.TargetFlag, command.TargetMaskTestnet) { continue } + + case config.BotNamePaguModerator: + if !utils.IsFlagSet(beCmd.TargetFlag, command.TargetMaskModerator) { + continue + } + + default: + log.Warn("invalid target", "target", bot.target) + continue } log.Info("registering new command", "name", beCmd.Name, "desc", beCmd.Help, "index", i, "object", beCmd) @@ -135,6 +144,10 @@ func (bot *Bot) registerCommands() error { if !utils.IsFlagSet(sCmd.TargetFlag, command.TargetMaskModerator) { continue } + + default: + log.Warn("invalid target", "target", bot.target) + continue } log.Info("adding command sub-command", "command", beCmd.Name,