]> jfr.im git - erebus.git/blobdiff - modules/trivia.py
userinfo - avoid filling memory with nonexistent users
[erebus.git] / modules / trivia.py
index 9f7624fef960c252e90287bb100fbcff5666d00e..3e79db35ed96434d3b4da8a0a941d3be28b5da5b 100644 (file)
@@ -1,4 +1,5 @@
 # Erebus IRC bot - Author: Erebus Team
+# vim: fileencoding=utf-8
 # trivia module
 # This file is released into the public domain; see http://unlicense.org/
 
@@ -851,7 +852,8 @@ def triviahelp(bot, user, chan, realtarget, *args):
                                bot.slowmsg(user, "HINTNUM       <hints>           (ADMIN)")
                                bot.slowmsg(user, "QUESTIONPAUSE <float seconds>   (ADMIN)")
 
-@lib.hooknum(332)
+@lib.hooknum(332) # topic is...
+@lib.hooknum(331) # no topic set
 def num_TOPIC(bot, textline):
        pieces = textline.split(None, 4)
        chan = pieces[3]
@@ -884,7 +886,7 @@ def num_TOPIC(bot, textline):
                'category': state.db['category'],
        }
        if gottopic != formatted:
-               state.getbot().conn.send("TOPIC %s :%s" % (state.db['chan'], formatted))
+               state.getbot().conn.send(bot.parent.cfg.get('trivia', 'topiccommand', default="TOPIC %(chan)s :%(topic)s") % {'chan': state.db['chan'], 'topic': formatted})
 
 
 def specialQuestion(oldq):