From 15068f45e239c6e8fb9149215935c0d97927c304 Mon Sep 17 00:00:00 2001 From: Dmitry Kim Date: Thu, 15 Mar 2007 01:12:23 +0000 Subject: + Added remotectl plugin and an example druby API client implementation --- data/rbot/plugins/remotectl.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 data/rbot/plugins/remotectl.rb (limited to 'data/rbot/plugins') 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) +# 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) -- cgit v1.2.3