Beta: clean up servers that opted out while the bot was offline

The bot remembers where it registered beta commands (beta_registered) and
removes them from servers that are no longer in the beta at the next start.
Failed cleanups are retried; a server the bot has left is forgotten.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
FernandoJVideiraandClaude Sonnet 5.5 committed 2026-10-23 01:32:20 +01:00
1 parent fcf4f3ccbd
commit 9839bba50e
9 files changed
+393 -30

No files matched your search

+7
View File
@@ -92,6 +92,13 @@ CREATE TABLE IF NOT EXISTS beta_guilds (
enabled_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Servers where the bot registered beta commands, so it can remove them even
-- if the server opted out while the bot was offline. Bot-owned (the API's
-- migration 000022 creates it for a combined database).
CREATE TABLE IF NOT EXISTS beta_registered (
guild_id BIGINT PRIMARY KEY
);
-- A server can have several lobbies (at most 10; the trigger enforces it, and
-- is the same as the API's migration 000020). meeting_settings.lobby_channel_id
-- is the old single-lobby column, no longer read.