def cmd(send, msg, args): """Returns a fortune. Syntax: !fortune <list|[-a|-o] [module]> """ if msg == 'list': fortunes = list_fortunes() + list_fortunes(True) send(" ".join(fortunes)) else: output = get_fortune(msg, args['name']) for line in output.splitlines(): send(line)
def cmd(send, msg, args): """Returns a fortune. Syntax: {command} <list|[-a|-o] [module]> """ if msg == 'list': fortunes = list_fortunes() + list_fortunes(True) send(" ".join(fortunes)) else: output = get_fortune(msg, args['name']) for line in output.splitlines(): send(line)
def gen_fortune(send): for line in get_fortune('-o').splitlines(): send(line)