Store updated channel id.
This commit is contained in:
@@ -496,7 +496,15 @@ async def get_clan_message_channel(
|
|||||||
return await guild.fetch_channel(channel_id)
|
return await guild.fetch_channel(channel_id)
|
||||||
except nextcord.NotFound:
|
except nextcord.NotFound:
|
||||||
# the channel was deleted for some reason
|
# the channel was deleted for some reason
|
||||||
return await guild.create_text_channel(
|
ret_channel = await guild.create_text_channel(
|
||||||
channel_name,
|
channel_name,
|
||||||
reason="Creating channel as required for by design of Dakiny-Messages repo.",
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user