summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-02 07:16:28 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-09-02 07:16:28 +0000
commit703163e4bbff82051f9adf46177fb2f2ce6d6ba6 (patch)
treeaf06cc1cd342a47368d7d232541b231451ca1573 /lib/rbot
parent7205060ebc35daf26a22ff6453b4faef477aaca7 (diff)
Refactor version string construction
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/core/config.rb10
-rw-r--r--lib/rbot/ircbot.rb1
2 files changed, 10 insertions, 1 deletions
diff --git a/lib/rbot/core/config.rb b/lib/rbot/core/config.rb
index 21073c23..7ff7a88c 100644
--- a/lib/rbot/core/config.rb
+++ b/lib/rbot/core/config.rb
@@ -9,6 +9,14 @@
class ConfigModule < CoreBotModule
+ def version_string
+ _("I'm a v. %{version} rubybot%{copyright}%{url}") % {
+ :version => $version,
+ :copyright => ", #{Irc::Bot::COPYRIGHT_NOTICE}",
+ :url => " - #{Irc::Bot::SOURCE_URL}"
+ }
+ end
+
def save
@bot.config.save
end
@@ -167,7 +175,7 @@ class ConfigModule < CoreBotModule
# end
def bot_version(m, param)
- m.reply _("I'm a v. %{version} rubybot, (c) Tom Gilbert and the rbot development team - http://linuxbrit.co.uk/rbot/") % {:version => $version}
+ m.reply version_string
end
def handle_help(m, params)
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index f1f39f30..d488e173 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -120,6 +120,7 @@ module Irc
# handles them or passes them to plugins, and contains core functionality.
class Bot
COPYRIGHT_NOTICE = "(c) Tom Gilbert and the rbot development team"
+ SOURCE_URL = "http://linuxbrit.co.uk"
# the bot's Auth data
attr_reader :auth