summaryrefslogtreecommitdiffstats
path: root/modules/invitejoin.bash
diff options
context:
space:
mode:
Diffstat (limited to 'modules/invitejoin.bash')
-rw-r--r--modules/invitejoin.bash15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/invitejoin.bash b/modules/invitejoin.bash
new file mode 100644
index 0000000..d76d85d
--- /dev/null
+++ b/modules/invitejoin.bash
@@ -0,0 +1,15 @@
+# modules/invitejoin.bash
+#
+# Joins channels when invited.
+
+
+if [ -z "$IRCBOT_MODULE" ]; then
+ printf "error: %s is a module for ircbot.bash and should not be run separately\n" "$0"
+ exit 1
+fi
+
+
+# joins the channel the bot was invited to
+on_self_invite() { # args: $1 - source, $2 - channel
+ sendmsg JOIN "$2"
+}