aboutsummaryrefslogtreecommitdiff
path: root/modules/strip_color.py
blob: 838fccc7917a13fd886b93577913359c729e5c16 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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"])