@hook.command('karma', 'k')
def karma(text, db):
 query = db.execute(select([karma_table]).where((karma_table.c.nick_vote == text.lower()))).fetchone()
 if (not query):
  return 'That user has no karma :('
 else:
  return '{} has \x02{}\x02 karma!'.format(text, (query['up_karma'] - query['down_karma']))

@ hook . command ( 'karma' , 'k' ) def karma ( text , db ) : query = db . execute ( select ( [ karma_table ] ) . where ( ( karma_table . c . nick_vote == text . lower ( ) ) ) ) . fetchone ( ) if ( not query ) : return 'That user has no karma :(' else : return '{} has \x02{}\x02 karma!' . format ( text , ( query [ 'up_karma' ] - query [ 'down_karma' ] ) )
k/karma <nick> -- returns karma stats for <nick> .