Skip to content

Commit 1994d64

Browse files
authored
Merge pull request CloudBotIRC#186 from linuxdaemon/gonzobot+fix-duck-stats
Fix usage of pluralize functions in duckhunt
2 parents f4acac1 + f450bec commit 1994d64

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

plugins/duckhunt.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def duck_merge(text, conn, db, message):
599599
db.execute(query)
600600
db.commit()
601601
message("Migrated {} and {} from {} to {}".format(
602-
pluralize(duckmerge["TKILLS"], "duck kill"), pluralize(duckmerge["TFRIENDS"], "duck friend"),
602+
pluralize_auto(duckmerge["TKILLS"], "duck kill"), pluralize_auto(duckmerge["TFRIENDS"], "duck friend"),
603603
oldnick, newnick
604604
))
605605
else:
@@ -633,17 +633,17 @@ def ducks_user(text, nick, chan, conn, db, message):
633633
# Check if the user has only participated in the hunt in this channel
634634
if ducks["chans"] == 1 and has_hunted_in_chan:
635635
message("{} has killed {} and befriended {} in {}.".format(
636-
name, pluralize(ducks["chankilled"], "duck"), pluralize(ducks["chanfriends"], "duck"), chan
636+
name, pluralize_auto(ducks["chankilled"], "duck"), pluralize_auto(ducks["chanfriends"], "duck"), chan
637637
))
638638
return
639639
kill_average = int(ducks["killed"] / ducks["chans"])
640640
friend_average = int(ducks["friend"] / ducks["chans"])
641641
message(
642642
"\x02{}'s\x02 duck stats: \x02{}\x02 killed and \x02{}\x02 befriended in {}. Across {} channels: \x02{}\x02 killed and \x02{}\x02 befriended. Averaging \x02{}\x02 and \x02{}\x02 per channel.".format(
643-
name, pluralize(ducks["chankilled"], "duck"), pluralize(ducks["chanfriends"], "duck"),
644-
chan, pluralize(ducks["chans"], "channel"),
645-
pluralize(ducks["killed"], "duck"), pluralize(ducks["friend"], "duck"),
646-
pluralize(kill_average, "kill"), pluralize(friend_average, "friend")
643+
name, pluralize_auto(ducks["chankilled"], "duck"), pluralize_auto(ducks["chanfriends"], "duck"),
644+
chan, pluralize_auto(ducks["chans"], "channel"),
645+
pluralize_auto(ducks["killed"], "duck"), pluralize_auto(ducks["friend"], "duck"),
646+
pluralize_auto(kill_average, "kill"), pluralize_auto(friend_average, "friend")
647647
)
648648
)
649649
else:
@@ -673,10 +673,10 @@ def duck_stats(chan, conn, db, message):
673673
friendchan, friendscore = sorted(ducks["friendchan"].items(), key=operator.itemgetter(1), reverse=True)[0]
674674
message(
675675
"\x02Duck Stats:\x02 {:,} killed and {:,} befriended in \x02{}\x02. Across {} \x02{:,}\x02 ducks have been killed and \x02{:,}\x02 befriended. \x02Top Channels:\x02 \x02{}\x02 with {} and \x02{}\x02 with {}".format(
676-
ducks["chankilled"], ducks["chanfriends"], chan, pluralize(ducks["chans"], "channel"),
676+
ducks["chankilled"], ducks["chanfriends"], chan, pluralize_auto(ducks["chans"], "channel"),
677677
ducks["killed"], ducks["friend"],
678-
killerchan, pluralize(killscore, "kill"),
679-
friendchan, pluralize(friendscore, "friend")
678+
killerchan, pluralize_auto(killscore, "kill"),
679+
friendchan, pluralize_auto(friendscore, "friend")
680680
))
681681
else:
682682
return "It looks like there has been no duck activity on this channel or network."

0 commit comments

Comments
 (0)