Promote development → master (initial production release: pre-release line + Stage 18) #104
@@ -103,6 +103,10 @@ func run(ctx context.Context, cfg config.BotConfig, logger *zap.Logger) error {
|
||||
// bot-link, no gateway — so onboarding works even when the game is down.
|
||||
var promo *promobot.Bot
|
||||
if cfg.PromoBotToken != "" {
|
||||
// The promo bot is auxiliary and shares this process with the main bot, so its
|
||||
// construction failure (a bad or unreachable promo token — tgbot.New validates it
|
||||
// with getMe) is logged and the promo bot is skipped, never fatal: it must not
|
||||
// take the main game bot down with it.
|
||||
promo, err = promobot.New(promobot.Config{
|
||||
Token: cfg.PromoBotToken,
|
||||
APIBaseURL: cfg.APIBaseURL,
|
||||
@@ -112,7 +116,8 @@ func run(ctx context.Context, cfg config.BotConfig, logger *zap.Logger) error {
|
||||
SendRatePerSecond: cfg.SendRatePerSecond,
|
||||
}, logger)
|
||||
if err != nil {
|
||||
return err
|
||||
logger.Error("promo bot disabled: construction failed (the main bot is unaffected)", zap.Error(err))
|
||||
promo = nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user