summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-08-13 02:17:15 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-08-13 02:17:15 +0200
commitc11d73206b365dfb04d1c5097ab36791995a593d (patch)
tree8daa6ed4e705ab5689127597e25ff1129ac55fe5 /lib
parenta993d1c358e24ab85621568c10411c5496e2dea8 (diff)
basics: UI reconnect command
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/core/basics.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/rbot/core/basics.rb b/lib/rbot/core/basics.rb
index 832cbb25..de48a575 100644
--- a/lib/rbot/core/basics.rb
+++ b/lib/rbot/core/basics.rb
@@ -73,6 +73,10 @@ class BasicsModule < CoreBotModule
@bot.restart param[:msg].to_s
end
+ def bot_reconnect(m, param)
+ @bot.reconnect param[:msg].to_s
+ end
+
def bot_hide(m, param)
@bot.join 0
end
@@ -133,6 +137,8 @@ class BasicsModule < CoreBotModule
_("quit [<message>] => quit IRC with message <message>")
when "restart"
_("restart => completely stop and restart the bot (including reconnect)")
+ when "reconnect"
+ _("reconnect => ask the bot to disconnect and then connect again")
when "join"
_("join <channel> [<key>] => join channel <channel> with secret key <key> if specified. #{@bot.myself} also responds to invites if you have the required access level")
when "part"
@@ -172,6 +178,10 @@ basics.map "restart *msg",
:action => 'bot_restart',
:defaults => { :msg => nil },
:auth_path => 'quit'
+basics.map "reconnect *msg",
+ :action => 'bot_reconnect',
+ :defaults => { :msg => nil },
+ :auth_path => 'quit'
basics.map "quiet [in] [:where]",
:action => 'bot_quiet',