2018-09-26 17:27:17 +00:00
|
|
|
from src import Utils
|
2018-09-03 07:29:58 +00:00
|
|
|
|
|
|
|
class Module(object):
|
|
|
|
def __init__(self, bot, events, exports):
|
|
|
|
exports.add("channelset", {"setting": "greeting",
|
|
|
|
"help": "Set a greeting to send to users when they join"})
|
|
|
|
|
2018-09-26 17:27:17 +00:00
|
|
|
@Utils.hook("recevied.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))
|