Handle a channel being deleted after entered into database.
This commit is contained in:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user