mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
Add markov, emojiboard, achievements, miniflux plugins and adventure catch-up fix
New plugins: encrypted Markov chain generation (9 commands), emojiboard reaction stats (5 views), Miniflux RSS feed integration (8 commands), and 48 new achievements across 9 categories. Adventure startup now unconditionally resets daily actions and respawns expired deaths to handle missed resets from SQLite contention. README updated with all new features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,8 +9,6 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"gogobee/internal/db"
|
||||
|
||||
"maunium.net/go/mautrix"
|
||||
"maunium.net/go/mautrix/id"
|
||||
)
|
||||
@@ -76,13 +74,12 @@ func (p *AdventurePlugin) Init() error {
|
||||
slog.Info("adventure: rehydrated DM rooms", "count", len(chars))
|
||||
}
|
||||
|
||||
// Catch up on missed jobs (e.g. after a redeploy or SQLite busy failure)
|
||||
dateKey := time.Now().UTC().Format("2006-01-02")
|
||||
if !db.JobCompleted("adventure_midnight", dateKey) {
|
||||
slog.Info("adventure: missed midnight reset detected, running catch-up")
|
||||
if err := resetAllAdvDailyActions(); err != nil {
|
||||
slog.Error("adventure: catch-up daily reset failed", "err", err)
|
||||
}
|
||||
// Always reset daily actions at startup — idempotent (WHERE clause
|
||||
// only touches characters whose last_action_date < today). This handles
|
||||
// the case where the old buggy code marked the midnight job as completed
|
||||
// even though the actual reset failed due to SQLite contention.
|
||||
if err := resetAllAdvDailyActions(); err != nil {
|
||||
slog.Error("adventure: startup daily reset failed", "err", err)
|
||||
}
|
||||
// Revive any characters whose DeadUntil has expired
|
||||
p.catchUpRespawns(chars)
|
||||
|
||||
Reference in New Issue
Block a user