2018-10-03 12:22:37 +00:00
|
|
|
from src import ModuleManager, utils
|
2018-09-03 07:29:58 +00:00
|
|
|
|
2018-10-03 12:22:37 +00:00
|
|
|
@utils.export("channelset", {"setting": "greeting",
|
2019-05-23 09:28:14 +00:00
|
|
|
"help": "Set a greeting to send to users when they join",
|
|
|
|
"example": "welcome to the channel!"})
|
2018-09-27 11:08:07 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2018-10-03 12:22:37 +00:00
|
|
|
@utils.hook("received.join")
|
2018-09-03 07:29:58 +00:00
|
|
|
def join(self, event):
|
|
|
|
greeting = event["channel"].get_setting("greeting", None)
|
|
|
|
if greeting:
|
|
|
|
event["user"].send_notice("[%s] %s" % (event["channel"].name,
|
|
|
|
greeting))
|