From 94c16a0bd3106f8c8bdcbaaaa1b9ac72b311d6c2 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 7 Feb 2004 12:19:15 +0000 Subject: [PATCH] Made version look online to find the newest version. --- src/Misc.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Misc.py b/src/Misc.py index e408f3911..033ca7d01 100755 --- a/src/Misc.py +++ b/src/Misc.py @@ -205,7 +205,17 @@ class Misc(callbacks.Privmsg): Returns the version of the current bot. """ - irc.reply(conf.version) + try: + newest = webutils.getUrl('http://supybot.sf.net/version.txt') + newest = 'The newest version available online is %s.' % version + except webutils.WebError, e: + self.log.warning('Couldn\'t get website version: %r', e) + newest = 'I could\'t fetch the newest version ' \ + 'from the Supybot website.' + s = 'The current (running) version of this Supybot is %s. %s' % \ + (conf.version, newest) + irc.reply(s) + version = privmsgs.thread(version) def revision(self, irc, msg, args): """[]