You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""".addpoint or (.pp) <thing> adds a point to the <thing>"""
25
26
text=text.strip()
26
27
db_init(db, conn.name)
27
-
karma=db.execute("select score from karma where name = :name and chan = :chan and thing = :thing", {'name':nick, 'chan': chan, 'thing': text.lower()}).fetchone()
28
+
karma=db.execute("select score from karma where name = :name and chan = :chan and thing = :thing", {'name':nick, 'chan': chan, 'thing': text.lower()}).fetchone()
#return "{} is now worth 1 in {}'s eyes.".format(text, nick)
38
+
# return "{} is now worth 1 in {}'s eyes.".format(text, nick)
39
+
38
40
39
41
@hook.regex(karmaplus_re)
40
42
defre_addpt(match, nick, chan, db, conn, notice):
41
43
"""no useful help txt"""
42
44
thing=match.group().split('++')[0]
43
45
ifthing:
44
46
addpoint(thing, nick, chan, db, conn)
45
-
#return out
47
+
#return out
46
48
else:
47
49
notice(pluspts(nick, chan, db, conn))
48
50
51
+
49
52
@hook.command("mm", "rmpoint")
50
53
defrmpoint(text, nick, chan, db, conn):
51
54
""".rmpoint or (.mm) <thing> subtracts a point from the <thing>"""
52
55
text=text.strip()
53
56
db_init(db, conn.name)
54
-
karma=db.execute("select score from karma where name = :name and chan = :chan and thing = :thing", {'name':nick, 'chan': chan, 'thing': text.lower()}).fetchone()
57
+
karma=db.execute("select score from karma where name = :name and chan = :chan and thing = :thing", {'name':nick, 'chan': chan, 'thing': text.lower()}).fetchone()
#return "{} is now worth -1 in {}'s eyes.".format(text, nick)
67
+
#return "{} is now worth -1 in {}'s eyes.".format(text, nick)
65
68
66
69
67
70
@hook.command("pluspts", autohelp=False)
68
71
defpluspts(nick, chan, db, conn):
69
-
"""prints the things you have liked"""
72
+
"""prints the things you have liked and their scores"""
70
73
db_init(db, conn.name)
71
74
output=""
72
-
likes=db.execute("select thing, score from karma where name = :name and chan = :chan and score >= 0 order by score desc", {'name': nick, 'chan': chan}).fetchall()
75
+
likes=db.execute("select thing, score from karma where name = :name and chan = :chan and score >= 0 order by score desc", {'name': nick, 'chan': chan}).fetchall()
73
76
forlikeinlikes:
74
-
output=output+str(like[0]) +" has "+str(like[1]) +" points "
77
+
output=output+str(like[0]) +" has "+str(like[1]) +" points "
75
78
returnoutput
76
79
80
+
77
81
@hook.command("minuspts", autohelp=False)
78
82
defminuspts(nick, chan, db, conn):
79
-
"""prints the things you have liked"""
83
+
"""prints the things you have disliked and their scores"""
80
84
db_init(db, conn.name)
81
85
output=""
82
-
likes=db.execute("select thing, score from karma where name = :name and chan = :chan and score <= 0 order by score", {'name': nick, 'chan': chan}).fetchall()
86
+
likes=db.execute("select thing, score from karma where name = :name and chan = :chan and score <= 0 order by score", {'name': nick, 'chan': chan}).fetchall()
83
87
forlikeinlikes:
84
-
output=output+str(like[0]) +" has "+str(like[1]) +" points "
88
+
output=output+str(like[0]) +" has "+str(like[1]) +" points "
""".topten or .pointstop prints the top 10 things with the highest points in the channel. To see the top 10 items in all of the channels the bot sits in use .topten global."""
134
+
""".topten or .pointstop or .loved prints the top 10 things with the highest points in the channel. To see the top 10 items in all of the channels the bot sits in use .topten global."""
""".bottomten or .pointsbottom prints the top 10 things with the highest points in the channel. To see the top 10 items in all of the channels the bot sits in use .topten global."""
165
+
""".bottomten or .pointsbottom or .hated prints the top 10 things with the lowest points in the channel. To see the bottom 10 items in all of the channels the bot sits in use .bottomten global."""
0 commit comments