def factoids_remove(connection, msg, chan, nick): """ Remove a factoid. """ global factoids factoid = msg[1] if len(msg) != 2: connection.privmsg(nick, 'Usage: @factoids remove <command>') elif not factoids.has_key(factoid): # If the command does not exist. connection.privmsg(nick, 'I\'ve never seen a factoid named {0}, sorry!'.format(factoid)) else: del factoids[factoid] connection.privmsg(nick, 'The factoid removed successfully.') ListFactoids(False) remove_help(factoid, "pub")
def unloader_factoids(): for factoid in factoids: remove_help(factoid, "pub")