Skip to content

Commit f964753

Browse files
authored
Merge pull request CloudBotIRC#107 from A-UNDERSCORE-D/gonzobot
fixed inconsistent behaviour with -global and global in karma.py
2 parents 39600bc + b231a1e commit f964753

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/karma.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def points(text, chan, db, conn):
103103
score = 0
104104
karma = ""
105105
thing = ""
106-
if text.endswith("-global"):
106+
if text.endswith("-global") or text.endswith(" global"):
107107
thing = text[:-7].strip()
108108
karma = db.execute("select score from karma where thing = :thing", {'thing': thing.lower()}).fetchall()
109109
else:
@@ -132,7 +132,7 @@ def pointstop(text, chan, db, message, conn, notice):
132132
points = defaultdict(int)
133133
items = ""
134134
out = ""
135-
if text == "global":
135+
if text == "global" or text == "-global":
136136
items = db.execute("select thing, score from karma").fetchall()
137137
out = "The top {} favorite things in all channels are: "
138138
else:
@@ -162,7 +162,7 @@ def pointsbottom(text, chan, db, message, conn, notice):
162162
points = defaultdict(int)
163163
items = ""
164164
out = ""
165-
if text == "global":
165+
if text == "global" or text == "-global":
166166
items = db.execute("select thing, score from karma").fetchall()
167167
out = "The {} most hated things in all channels are: "
168168
else:

0 commit comments

Comments
 (0)