def do_add_quote(nick, quote, session, isadmin, send, args): row = Quotes(quote=quote, nick=nick, submitter=args['nick']) session.add(row) session.flush() if isadmin: row.approved = 1 send("Added quote %d!" % row.id) else: send("Quote submitted for approval.", target=args['nick']) send("New Quote: #%d %s -- %s, Submitted by %s" % (row.id, quote, nick, args['nick']), target=args['config']['core']['ctrlchan'])
def do_add_quote(cmd, session, isadmin, send, args): #FIXME: have better parsing. if '--' not in cmd: send("To add a quote, it must be in the format <quote> -- <nick>") return quote = cmd.split('--') # strip off excess leading/ending spaces quote = [x.strip() for x in quote] row = Quotes(quote=quote[0], nick=quote[1], submitter=args['nick']) session.add(row) session.flush() if isadmin: row.approved = 1 send("Added quote %d!" % row.id) else: send("Quote submitted for approval.", target=args['nick']) send("New Quote: #%d %s -- %s, Submitted by %s" % (row.id, quote[0], quote[1], args['nick']), target=args['config']['core']['ctrlchan'])
def do_add_quote(cmd, session, isadmin, send, args): # FIXME: have better parsing. if '--' not in cmd: send("To add a quote, it must be in the format <quote> -- <nick>") return quote = cmd.split('--') # strip off excess leading/ending spaces quote = [x.strip() for x in quote] row = Quotes(quote=quote[0], nick=quote[1], submitter=args['nick']) session.add(row) session.flush() if isadmin: row.approved = 1 send("Added quote %d!" % row.id) else: send("Quote submitted for approval.", target=args['nick']) send("New Quote: #%d %s -- %s, Submitted by %s" % (row.id, quote[0], quote[1], args['nick']), target=args['config']['core']['ctrlchan'])