aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/greeting.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/greeting.py b/modules/greeting.py
index 9f5b9b78..a25e2e12 100644
--- a/modules/greeting.py
+++ b/modules/greeting.py
@@ -2,6 +2,8 @@
from src import ModuleManager, utils
+CAP = utils.irc.Capability("message-tags", "draft/message-tags-0.2")
+
@utils.export("channelset", utils.Setting("greeting",
"Set a greeting to send to users when they join",
example="welcome to the channel!"))
@@ -10,5 +12,9 @@ class Module(ModuleManager.BaseModule):
def join(self, event):
greeting = event["channel"].get_setting("greeting", None)
if greeting:
+ tags = {}
+ if event["server"].has_capability(CAP):
+ tags["+draft/channel-context"] = event["channel"].name
+
event["user"].send_notice("[%s] %s" % (event["channel"].name,
- greeting))
+ greeting), tags)