From 72fa9c21664311893a8342d8611ca5fc05796c4a Mon Sep 17 00:00:00 2001 From: Twentysix Date: Sun, 13 Mar 2016 00:17:13 +0100 Subject: [PATCH] Added bitness error checking for opus --- cogs/audio.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cogs/audio.py b/cogs/audio.py index bef4adb57..fcbf5f64e 100644 --- a/cogs/audio.py +++ b/cogs/audio.py @@ -23,7 +23,9 @@ except: try: if not discord.opus.is_loaded(): discord.opus.load_opus('libopus-0.dll') -except: +except OSError: # Incorrect bitness + opus = False +except: # Missing opus opus = None else: opus = True @@ -791,7 +793,10 @@ def setup(bot): if youtube_dl is None: raise RuntimeError("You need to run `pip3 install youtube_dl`") return - if opus is None: + if opus is False: + raise RuntimeError("Your opus library's bitness must match your python installation's bitness. They both must be either 32bit or 64bit.") + return + elif opus is None: raise RuntimeError("You need to install ffmpeg and opus. See \"https://github.com/Twentysix26/Red-DiscordBot/wiki/Requirements\"") return loop = asyncio.get_event_loop()