aboutsummaryrefslogtreecommitdiff
path: root/modules/greeting.py
blob: 3e527606f9e5ead74b0aaec1d1c8d0999e0d0391 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
from src import ModuleManager, utils

@utils.export("channelset", {"setting": "greeting",
    "help": "Set a greeting to send to users when they join",
    "example": "welcome to the channel!"})
class Module(ModuleManager.BaseModule):
    @utils.hook("received.join")
    def join(self, event):
        greeting = event["channel"].get_setting("greeting", None)
        if greeting:
            event["user"].send_notice("[%s] %s" % (event["channel"].name,
                greeting))