From 5726875c594506bfeec855e6e3957c6c3e85a7dc Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 15 May 2024 14:15:11 -0400 Subject: [PATCH] Store updated channel id. --- utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 6ee956e..b462915 100644 --- a/utils.py +++ b/utils.py @@ -496,7 +496,15 @@ async def get_clan_message_channel( return await guild.fetch_channel(channel_id) except nextcord.NotFound: # the channel was deleted for some reason - return await guild.create_text_channel( + ret_channel = await guild.create_text_channel( channel_name, reason="Creating channel as required for by design of Dakiny-Messages repo.", ) + stmt = ( + update(Messages) + .where(Messages.Path == channel_name) + .values(Id=ret_channel.id) + ) + session.execute(stmt) + session.commit() + return ret_channel