bitbot-3.11-fork/modules/greeting.py

14 lines
466 B
Python
Raw Normal View History

2018-09-03 07:29:58 +00:00
class Module(object):
def __init__(self, bot, events, exports):
events.on("received.join").hook(self.join)
exports.add("channelset", {"setting": "greeting",
"help": "Set a greeting to send to users when they join"})
def join(self, event):
greeting = event["channel"].get_setting("greeting", None)
if greeting:
event["user"].send_notice("[%s] %s" % (event["channel"].name,
greeting))