aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2021-10-31 15:49:54 +0000
committerGravatar Chris Lovering <[email protected]>2021-12-21 19:02:14 +0000
commit085e25f1d5bf2462da3641b727786fcc2e00dcaf (patch)
tree30bdf226c1aedaaff9979f13e7d22b8dcce63cb7
parentUpsert threads when syncing channels (diff)
Update stored thread data on thread update
-rw-r--r--metricity/bot.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/metricity/bot.py b/metricity/bot.py
index 84f163d..2e6b41d 100644
--- a/metricity/bot.py
+++ b/metricity/bot.py
@@ -181,6 +181,17 @@ async def on_guild_channel_update(_before: Messageable, channel: Messageable) ->
@bot.event
+async def on_thread_update(thread: Messageable) -> None:
+ """Sync the channels when one is updated."""
+ await db_ready.wait()
+
+ if thread.guild.id != BotConfig.guild_id:
+ return
+
+ await sync_channels(thread.guild)
+
+
async def on_guild_available(guild: Guild) -> None:
"""Synchronize the user table with the Discord users."""
await db_ready.wait()