Skip to content

Commit

Permalink
Merge branch 'gonzobot' of github.com:snoonetIRC/CloudBot into gonzobot
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardslabs committed Jan 4, 2018
2 parents 7ba6581 + 27615fe commit 640429f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/duckhunt.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,10 @@ def update_score(nick, chan, db, conn, shoot=0, friend=0):
.where(table.c.name == nick.lower())).fetchone()
if score:
dbupdate(nick, chan, db, conn, score[0] + shoot, score[1] + friend)
return {'shoot': score[0] + shoot, 'friend': score[1] + friend}
else:
dbadd_entry(nick, chan, db, conn, shoot, friend)
return {'shoot': shoot, 'friend': friend}


def attack(nick, chan, message, db, conn, notice, attack):
Expand Down Expand Up @@ -355,13 +357,12 @@ def attack(nick, chan, message, db, conn, notice, attack):

status['duck_status'] = 2
try:
score = 1
args = {
attack_type: score
attack_type: 1
}

update_score(nick, chan, db, conn, **args)
except DatabaseError:
score = update_score(nick, chan, db, conn, **args)[attack_type]
except Exception:
status['duck_status'] = 1
raise

Expand Down

0 comments on commit 640429f

Please sign in to comment.