[Fix] Prevent error if a TOT channel is deleted (#165)

* Add fix for if a TOT channel is deleted

* version

Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
This commit is contained in:
Neuro Assassin
2020-10-06 10:56:50 -04:00
committed by GitHub
parent e7647bda90
commit 3b38c5293e

View File

@@ -9,7 +9,7 @@ from redbot.core import commands, checks, Config, bank
from redbot.core.utils.chat_formatting import box, pagify, humanize_number
from redbot.core.utils.menus import menu, DEFAULT_CONTROLS
__version__ = "0.1.2"
__version__ = "0.1.3"
class TrickOrTreat(commands.Cog):
@@ -447,7 +447,8 @@ class TrickOrTreat(commands.Cog):
channel_msg = "Trick or Treat Channels:\n"
for chan in channel_list:
channel_obj = self.bot.get_channel(chan)
channel_msg += f"{channel_obj.name}\n"
if channel_obj:
channel_msg += f"{channel_obj.name}\n"
await ctx.send(box(channel_msg))
@commands.guild_only()