This commit is contained in:
Luke Rogers 2013-09-11 13:44:02 +12:00
parent 931eb1f51a
commit dde9b97223
2 changed files with 9 additions and 8 deletions

View file

@ -30,8 +30,8 @@ def up(db, nick_vote):
def down(db, nick_vote): def down(db, nick_vote):
db.execute("""UPDATE karma SET db.execute("""UPDATE karma SET
down_karma = down_karma+1, down_karma = down_karma + 1,
total_karma = total_karma+1 WHERE nick_vote=?""", (nick_vote.lower(),)) total_karma = total_karma + 1 WHERE nick_vote=?""", (nick_vote.lower(),))
db.commit() db.commit()
@ -123,9 +123,9 @@ def karma(inp, nick='', chan='', db=None):
(nick_vote.lower(),)).fetchall() (nick_vote.lower(),)).fetchall()
if not out: if not out:
return "no karma" return "That user has no karma."
else: else:
out = out[0] out = out[0]
return "'%s' has %s karma" % (nick_vote, out[1]-out[2]) return "%s has \x02%s\x02 karma." % (nick_vote, out[1]-out[2])
return return

9
plugins/todo.py → plugins/notes.py Executable file → Normal file
View file

@ -88,9 +88,10 @@ def db_search(db, nick, query):
""", (query, nick)) """, (query, nick))
@hook.command("notes")
@hook.command @hook.command
def todo(inp, nick='', chan='', db=None, notice=None, bot=None): def note(inp, nick='', chan='', db=None, notice=None, bot=None):
"todo (add|del|list|search) args -- Manipulates your list of todos." "note(s) <add|del|list|search> args -- Manipulates your list of notes."
db_init(db) db_init(db)
@ -100,7 +101,7 @@ def todo(inp, nick='', chan='', db=None, notice=None, bot=None):
args = parts[1:] args = parts[1:]
# code to allow users to access each others factoids and a copy of help # code to allow users to access each others factoids and a copy of help
# ".todo (add|del|list|search) [@user] args -- Manipulates your list of todos." # ".note (add|del|list|search) [@user] args -- Manipulates your list of todos."
#if len(args) and args[0].startswith("@"): #if len(args) and args[0].startswith("@"):
# nick = args[0][1:] # nick = args[0][1:]
# args = args[1:] # args = args[1:]
@ -113,7 +114,7 @@ def todo(inp, nick='', chan='', db=None, notice=None, bot=None):
db_add(db, nick, text) db_add(db, nick, text)
notice("Task added!") notice("Note added!")
return return
elif cmd == 'get': elif cmd == 'get':
if len(args): if len(args):