Browse Source

add support for loading a level getter from a module/function path

feature/docs
Andrei 8 years ago
parent
commit
e42e9ebe63
  1. 6
      disco/bot/bot.py

6
disco/bot/bot.py

@ -140,6 +140,12 @@ class Bot(LoggingClass):
if self.config.commands_allow_edit:
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)):
mod, func = self.config.commands_level_getter.rsplit('.', 1)
mod = importlib.import_module(mod)
self.config.commands_level_getter = getattr(mod, func)
# Stores the last message for every single channel
self.last_message_cache = {}

Loading…
Cancel
Save