+ bot.msg(user, "That category doesn't exist.")
+
+@lib.hook(needchan=False)
+@lib.help(None, "list categories", "the current category will be marked with a *")
+def listcats(bot, user, chan, realtarget, *args):
+ cats = ["%s%s (%d)" % ("*" if c == state.db['category'] else "", c, len(state.db['questions'][c])) for c in state.db['questions'].keys()]
+ bot.msg(user, "Categories: %s" % (', '.join(cats)))
+
+@lib.hook(glevel=lib.STAFF, needchan=False)
+@lib.help("<category>", "adds an empty category")
+def addcat(bot, user, chan, realtarget, *args):
+ category = args[0].lower()
+ if category not in state.db['questions']:
+ state.db['questions'][category] = []
+ bot.msg(user, "Added category %s" % (category))
+ else:
+ bot.msg(user, "Category already exists.")
+
+@lib.hook(glevel=lib.MANAGER, needchan=False)
+@lib.help("<category>", "deletes an entire category")
+def delcat(bot, user, chan, realtarget, *args):
+ category = args[0].lower()
+ if category == state.db['category']:
+ bot.msg(user, "Category currently in use!")
+ elif category in state.db['questions']:
+ length = len(state.db['questions'][category])
+ del state.db['questions'][category]
+ bot.msg(user, "Deleted category %s (%d questions)" % (category, length))
+ else:
+ bot.msg(user, "Category does not exist.")
+
+@lib.hook(needchan=False)
+def triviahelp(bot, user, chan, realtarget, *args):
+ bot.slowmsg(user, "START")
+ bot.slowmsg(user, "TOP10")
+ bot.slowmsg(user, "POINTS [<user>]")
+ bot.slowmsg(user, "RANK [<user>]")
+ bot.slowmsg(user, "BADQ <reason> (include info to identify question)")