2018-09-30 16:29:09 +00:00
|
|
|
|
2018-10-03 12:22:37 +00:00
|
|
|
from src import ModuleManager, utils
|
2016-04-18 15:50:19 +00:00
|
|
|
|
2018-09-26 17:27:17 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2018-10-03 12:22:37 +00:00
|
|
|
@utils.hook("preprocess.command")
|
2016-04-18 15:50:19 +00:00
|
|
|
def preprocess_command(self, event):
|
2018-09-30 16:29:09 +00:00
|
|
|
require_mode = event["hook"].get_kwarg("require_mode")
|
|
|
|
if event["is_channel"] and require_mode:
|
2018-07-02 15:15:26 +00:00
|
|
|
if not event["target"].mode_or_above(event["user"],
|
2018-09-30 19:53:36 +00:00
|
|
|
require_mode):
|
2016-04-18 15:50:19 +00:00
|
|
|
return "You do not have permission to do this"
|