Add greeting.py
This commit is contained in:
parent
ecc93183f5
commit
61b2682c93
1 changed files with 13 additions and 0 deletions
13
modules/greeting.py
Normal file
13
modules/greeting.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
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))
|
Loading…
Reference in a new issue