aboutsummaryrefslogtreecommitdiff
path: root/modules/strip_color.py
blob: a1bfa752e9a251f69fb52039103d3f70498f8b15 (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.irc.strip_font(event["line"])