summaryrefslogtreecommitdiff
path: root/data/rbot
diff options
context:
space:
mode:
authorDmitry Kim <dmitry point kim at gmail point com>2007-03-15 01:12:23 +0000
committerDmitry Kim <dmitry point kim at gmail point com>2007-03-15 01:12:23 +0000
commit15068f45e239c6e8fb9149215935c0d97927c304 (patch)
treefcf11b1c2862af30be09b5102be07dc781407b54 /data/rbot
parent91100d59ee74594114ce35c0f19a9d386df77690 (diff)
+ Added remotectl plugin and an example druby API client implementation
Diffstat (limited to 'data/rbot')
-rw-r--r--data/rbot/plugins/remotectl.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/data/rbot/plugins/remotectl.rb b/data/rbot/plugins/remotectl.rb
new file mode 100644
index 00000000..b5b460fe
--- /dev/null
+++ b/data/rbot/plugins/remotectl.rb
@@ -0,0 +1,30 @@
+#-- vim:sw=4:et
+#++
+#
+# :title: RemoteCtl plugin
+#
+# Author:: jsn (dmitry kim) <dmitry dot kim at gmail dot org>
+# Copyright:: (C) 2007 dmitry kim
+# License:: in public domain
+#
+# Adds druby remote command execution to rbot. See 'bin/rbot-remote' for
+# example usage.
+
+class RemoteCtlPlugin < Plugin
+ include RemotePlugin
+
+ def remote_command(m, params)
+ s = params[:string].to_s
+ new_m = PrivMessage.new(@bot, @bot.server, m.source, @bot.nick, s)
+ @bot.plugins.delegate "listen", new_m
+ @bot.plugins.privmsg(new_m)
+ end
+end
+
+me = RemoteCtlPlugin.new
+
+me.remote_map 'dispatch *string',
+ :action => 'remote_command',
+ :action_path => 'dispatch'
+
+me.default_auth('*', false)