summaryrefslogtreecommitdiff
path: root/modules/quotes.py
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-05-26 18:33:03 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-05-26 18:33:03 +0200
commitc23d205928499b578e0742363dbfd8dc0116f394 (patch)
tree3b28becd52bd3cee3af26b6bcbd484df8bc4dd9f /modules/quotes.py
parentb4b59bf076d8d4ec22b489174707ecda72a1c06e (diff)
Replaced module's __call__ with a keyword mechanism.
Diffstat (limited to 'modules/quotes.py')
-rw-r--r--modules/quotes.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/quotes.py b/modules/quotes.py
index a5060cd..54cacd9 100644
--- a/modules/quotes.py
+++ b/modules/quotes.py
@@ -16,7 +16,7 @@ class Quotes:
return q
def connect(self, db):
- self.db = PgSQL.connect(database = 'fot')
+ self.db = PgSQL.connect(database = 'fot', host = 'komachi.')
self.updatecount()
def updatecount(self):
@@ -201,13 +201,10 @@ quote_handler = IRCHandler()
class Module:
def __init__(self, bot):
self.irc = bot
+ self.irc.register_keyword('!quote', self)
- def __call__(self, nick, channel, msg):
- if not msg.startswith('!quote'):
- return
+ def keyword(self, nick, channel, kw, msg):
args = msg.split(' ')
- if msg.startswith('!quote'):
- args = args[1:]
cmd = args[0] if len(args) and len(args[0].strip()) else 'random'
args = args[1:]