forked from sass/tipibot
Add startup scheme
This commit is contained in:
15
bot.py
15
bot.py
@@ -383,6 +383,21 @@ async def on_ready():
|
||||
log.info("Logged in as %s (ID: %s)", bot.user, bot.user.id)
|
||||
economy.set_house(bot.user.id)
|
||||
|
||||
# PocketBase silently drops writes to fields missing from the collection
|
||||
# schema, so surface any drift loudly instead of letting features no-op.
|
||||
try:
|
||||
missing = await economy.missing_schema_fields()
|
||||
if missing:
|
||||
log.error(
|
||||
"PocketBase collection '%s' is missing %d schema field(s): %s "
|
||||
"- writes to them are silently dropped! Run scripts/sync_pb_schema.py.",
|
||||
config.PB_ECONOMY_COLLECTION, len(missing), ", ".join(missing),
|
||||
)
|
||||
else:
|
||||
log.info("PocketBase schema check passed (%s)", config.PB_ECONOMY_COLLECTION)
|
||||
except Exception as e:
|
||||
log.warning("Could not verify PocketBase schema: %s", e)
|
||||
|
||||
_apply_profile_command_filters()
|
||||
|
||||
# Pull sheet data into cache
|
||||
|
||||
Reference in New Issue
Block a user