summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-12-29 16:23:29 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-12-29 16:23:29 +0100
commitaa06588ee2bfffd38107a80181b14ca1c4a17694 (patch)
treee2efdaaef1cc89b30f91784fb00f1e108a97ec7a /modules
parent46fe98005e944437f120ccc88506af5efa2acd63 (diff)
gcalc: Check for self.irc in __init__().
Diffstat (limited to 'modules')
-rw-r--r--modules/gcalc.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gcalc.py b/modules/gcalc.py
index 6abee92..ea317af 100644
--- a/modules/gcalc.py
+++ b/modules/gcalc.py
@@ -9,7 +9,8 @@ import urllib, urllib2, json
class Module:
def __init__(self, bot):
self.irc = bot
- self.irc.register_keyword('!gcalc', self)
+ if self.irc:
+ self.irc.register_keyword('!gcalc', self)
def calc(self, s):
url = 'http://www.google.com/ig/calculator?%s' % urllib.urlencode({'q': s})