From ef1608b482f35bdef82b801a0201c148e5595081 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Sat, 27 Aug 2016 22:32:11 -0500 Subject: [PATCH] Added a silent exception for playing music and not having permissions to send messages, as this seems to happen commonly based on error logs --- cogs/playlist.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cogs/playlist.py b/cogs/playlist.py index 605c5de..45fdbf2 100644 --- a/cogs/playlist.py +++ b/cogs/playlist.py @@ -289,13 +289,16 @@ class Music: return except IndexError: fmt = "Sorry, but there's no result with that search time! Try something else" - await self.bot.say(fmt) + await self.bot.send_message(ctx.message.channel, fmt) return # Now we can create a VoiceEntry and queue it entry = VoiceEntry(ctx.message, player) await state.songs.put(entry) - await self.bot.say('Enqueued ' + str(entry)) + try: + await self.bot.say('Enqueued ' + str(entry)) + except discord.Forbidden: + pass @commands.command(pass_context=True, no_pm=True) @checks.custom_perms(kick_members=True)