bitbot-3.11-fork/modules/strip_color.py
2018-09-30 20:12:11 +01:00

10 lines
424 B
Python

from src import ModuleManager, Utils
@Utils.export("serverset", {"setting": "strip-color",
"help": "Set whether I strip colors from my messages on this server",
"validate": Utils.bool_or_none})
class Module(ModuleManager.BaseModule):
@Utils.hook("preprocess.send")
def preprocess(self, event):
if event["server"].get_setting("strip-color", False):
return Utils.strip_font(event["line"])