diff options
Diffstat (limited to 'modules/log.py')
-rw-r--r-- | modules/log.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/log.py b/modules/log.py index 04ea721..ff8093e 100644 --- a/modules/log.py +++ b/modules/log.py @@ -1,29 +1,29 @@ -from base import ModuleBase +from . import ModuleBase class Module(ModuleBase): def __init__(self, manager): ModuleBase.__init__(self, manager) - self.db = manager.get('mysql').db + self.mysql = manager.get('mysql') def helptexts(self): return ['Chatlogs werden auch erstellt.'] def groupchat(self, room, nick, text, handler): - cursor = self.db.cursor() + cursor = self.mysql.cursor() cursor.execute('INSERT INTO log (`type`, `time`, `room`, `nick`, `text`) VALUES ("message", NOW(), %s, %s, %s)', (room, nick, text)) cursor.close() def join(self, room, nick, show, status, handler): - cursor = self.db.cursor() + cursor = self.mysql.cursor() cursor.execute('INSERT INTO log (`type`, `time`, `room`, `nick`, `show`, `text`) VALUES ("join", NOW(), %s, %s, %s, %s)', (room, nick, show, status)) cursor.close() def leave(self, room, nick, show, status, handler): - cursor = self.db.cursor() + cursor = self.mysql.cursor() cursor.execute('INSERT INTO log (`type`, `time`, `room`, `nick`, `show`, `text`) VALUES ("leave", NOW(), %s, %s, %s, %s)', (room, nick, show, status)) cursor.close() def topic(self, room, nick, text, handler): - cursor = self.db.cursor() + cursor = self.mysql.cursor() cursor.execute('INSERT INTO log (`type`, `time`, `room`, `nick`, `text`) VALUES ("topic", NOW(), %s, %s, %s)', (room, nick, text)) cursor.close() |