Skip to content

Commit

Permalink
Ensure thread archive state is also synced when syncing channels
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Jun 18, 2024
1 parent e68d83d commit b49dd53
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion metricity/exts/event_listeners/_syncer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ async def sync_channels(bot: Bot, guild: discord.Guild) -> None:
if thread.parent.category.id in BotConfig.ignore_categories:
continue
else:
# This is a forum channel, not currently supported by Discord.py. Ignore it.
# This use to happen for forum channels, when not supported by Discord.py.
# This case should no longer be possible, but will be kept for future possibilities.
continue

if db_thread := await sess.get(models.Thread, str(thread.id)):
Expand All @@ -130,6 +131,8 @@ async def sync_channels(bot: Bot, guild: discord.Guild) -> None:
insert_thread(thread, sess)
await sess.commit()

log.info("Thread synchronisation process complete, synchronising deleted threads")
await sync_thread_archive_state(guild)
log.info("Thread synchronisation process complete, finished synchronising guild.")
bot.channel_sync_in_progress.set()

Expand Down

0 comments on commit b49dd53

Please sign in to comment.