Handle a channel being deleted after entered into database.

This commit is contained in:
2024-05-15 13:33:07 -04:00
parent 36c738bfaa
commit b9362f7eca
+8 -1
View File
@@ -135,7 +135,14 @@ class ClanMessages(commands.Cog, name="Clan Messages"):
session.commit()
return ret_channel
return await guild.fetch_channel(channel_id)
try:
return await guild.fetch_channel(channel_id)
except nextcord.NotFound:
# the channel was deleted for some reason
return await guild.create_text_channel(
channel_name,
reason="Creating channel as required for by design of Dakiny-Messages repo.",
)
def repo_setup(self):
"""