Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/sevabot/bot/handlers.py b/sevabot/bot/handlers.py
- index 7cddf09..005eb84 100644
- --- a/sevabot/bot/handlers.py
- +++ b/sevabot/bot/handlers.py
- @@ -8,6 +8,8 @@ from __future__ import absolute_import, division, unicode_literals
- import re
- import logging
- import shlex
- +import settings
- +
- from inspect import getmembers, ismethod
- from sevabot.bot import modules
- @@ -101,11 +103,15 @@ class CommandHandler:
- msg.Chat.SendMessage(output)
- script_module.run(msg, command_args, callback)
- - else:
- - msg.Chat.SendMessage("Don't know about command: !" + command_name)
- +# else:
- +# msg.Chat.SendMessage("Don't know about command: !" + command_name)
- def builtin_reload(self, args, msg, status):
- - """Reload command modules.
- - """
- - commands = modules.load_modules(self.sevabot)
- - msg.Chat.SendMessage('Available commands: %s' % ', '.join(commands))
- + """Reload command modules."""
- + username = ensure_unicode(msg.Sender.Handle).encode('utf-8')
- + if msg.Sender.Handle in settings.ADMINS:
- + commands = modules.load_modules(self.sevabot)
- + msg.Chat.SendMessage('Available commands: %s' % ', '.join(commands))
- + else:
- + logger.warning('User %s tried execute built-in command reload, but access was denied!' % username.encode('utf-8'))
- + msg.Chat.SendMessage('Permission denied for user: %s' % username.encode('utf-8'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement