diff --git a/disco/bot/bot.py b/disco/bot/bot.py index 4d43a27..ce8b4f3 100644 --- a/disco/bot/bot.py +++ b/disco/bot/bot.py @@ -141,7 +141,7 @@ class Bot(LoggingClass): self.client.events.on('MessageUpdate', self.on_message_update) # If we have a level getter and its a string, try to load it - if isinstance(self.config.commands_level_getter, (str, unicode)): + if isinstance(self.config.commands_level_getter, six.string_types): mod, func = self.config.commands_level_getter.rsplit('.', 1) mod = importlib.import_module(mod) self.config.commands_level_getter = getattr(mod, func) diff --git a/disco/types/base.py b/disco/types/base.py index 670ab07..ff9937f 100644 --- a/disco/types/base.py +++ b/disco/types/base.py @@ -207,6 +207,9 @@ def datetime(data): def text(obj): + if obj is None: + return None + if six.PY2: if isinstance(obj, str): return obj.decode('utf-8') @@ -216,6 +219,9 @@ def text(obj): def binary(obj): + if obj is None: + return None + if six.PY2: if isinstance(obj, str): return obj.decode('utf-8')