Revert "Toast off ducks.py with .duckstats"

This reverts commit 3044b83
This commit is contained in:
dngfx 2018-09-01 20:40:26 +01:00
parent 3044b833fc
commit 93a818ed97

View file

@ -28,11 +28,8 @@ class Module(object):
help="See who the friendliest people to ducks are!")
events.on("received.command.killers").hook(self.duck_enemies,
help="See who shoots the most amount of ducks.")
events.on("received.command.duckstats").hook(self.duck_stats,
help="Shows the total "
"amount of ducks "
"you've shot and "
"befriended")
# events.on("received.command.ducks").hook(self.duck_list,
# help="Shows a list of the most popular duck superstars.")
events.on("postboot").on("configure").on(
@ -222,42 +219,3 @@ class Module(object):
next_decoy_time = self.get_random_duck_time()
self.bot.add_timer("duck-decoy", next_decoy_time, persist=False,
server=event["server"], channel=event["target"])
def duck_stats(self, event):
user = event["user"]
channel = event["target"].name
nick = user.nickname
id = user.id
poached = user.get_channel_settings_per_setting("ducks-shot", 0
)
friends = user.get_channel_settings_per_setting(
"ducks-befriended", 0
)
channel_friends = 0
channel_poached = 0
total_friends = 0
total_poached = 0
for room, number in friends:
if room == channel:
channel_friends = number
total_friends += number
else:
total_friends += number
for room, number in poached:
if room == channel:
channel_poached = number
total_poached += number
else:
total_poached += number
event["stdout"].write(
nick + ": " + str(total_poached) + " ducks killed (" + str(
channel_poached) + " in " + channel + "), and " + str(
total_friends) + " ducks befriended (" + str(channel_friends)
+ " in " + channel + ")")