Browse Source

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...
pull/179/head
A5rocks 5 years ago
parent
commit
055bda2a84
No known key found for this signature in database GPG Key ID: 8542650F5C52A517
  1. 6
      disco/bot/bot.py

6
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 = {}

Loading…
Cancel
Save