From 055bda2a8455895f7e78f594c503025cbf7d26bc Mon Sep 17 00:00:00 2001 From: A5rocks <40616000+A5rocks@users.noreply.github.com> Date: Thu, 16 Apr 2020 01:23:34 +0900 Subject: [PATCH] Correct an oversight with the custom prefix getter. This allows people to supply a string that will then be used (for those who don't want to use programmatic running). Even if this is out of scope for this PR, I still feel obligated to fix my mistakes... --- disco/bot/bot.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/disco/bot/bot.py b/disco/bot/bot.py index 2dc9646..bbf9716 100644 --- a/disco/bot/bot.py +++ b/disco/bot/bot.py @@ -186,6 +186,12 @@ class Bot(LoggingClass): mod = importlib.import_module(mod) self.config.commands_level_getter = getattr(mod, func) + # same for custom prefix getter + if isinstance(self.config.commands_prefix_getter, six.string_types): + mod, func = self.config.commands_prefix_getter.rsplit('.', 1) + mod = importlib.import_module(mod) + self.config.commands_prefix_getter = getattr(mod, func) + # Stores the last message for every single channel self.last_message_cache = {}