summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2005-08-07 16:57:33 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2005-08-07 16:57:33 +0000
commit7baa666805fdf3157e97d03913ea5e13b0e228a1 (patch)
treec551a8d7dc0c8c625cb3bda3ebffcdfe82232ac2
parentb50352520924d5e7a912a03719d5935f74e498d4 (diff)
Sun Aug 07 17:53:06 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* workaround for people without YAML::load_file * quit message for restart
-rw-r--r--ChangeLog5
-rw-r--r--lib/rbot/ircbot.rb9
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index d137da10..9f2263b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Aug 07 17:53:06 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
+
+ * workaround for people without YAML::load_file
+ * quit message for restart
+
Sun Aug 07 15:11:07 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>
* fix address_prefix, broken in 0.9.9, reported by ruskie.
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index 7cfda371..c71386bc 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -459,8 +459,9 @@ class IrcBot
end
# totally shutdown and respawn the bot
- def restart
- shutdown("restarting, back in #{@config['server.reconnect_wait']}...")
+ def restart(message = false)
+ msg = message ? message : "restarting, back in #{@config['server.reconnect_wait']}..."
+ shutdown(msg)
sleep @config['server.reconnect_wait']
# now we re-exec
exec($0, *@argv)
@@ -631,8 +632,8 @@ class IrcBot
part $1 if(@auth.allow?("join", m.source, m.replyto))
when (/^quit(?:\s+(.*))?$/i)
quit $1 if(@auth.allow?("quit", m.source, m.replyto))
- when (/^restart$/i)
- restart if(@auth.allow?("quit", m.source, m.replyto))
+ when (/^restart(?:\s+(.*))?$/i)
+ restart $1 if(@auth.allow?("quit", m.source, m.replyto))
when (/^hide$/i)
join 0 if(@auth.allow?("join", m.source, m.replyto))
when (/^save$/i)