Skip to content

Commit

Permalink
Merge pull request #83 from ProbablyButter/main
Browse files Browse the repository at this point in the history
zookie pics
  • Loading branch information
makayla-moster authored Nov 26, 2024
2 parents a281d25 + 70f0ff8 commit 6ed032a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
26 changes: 26 additions & 0 deletions cog_modules/random/cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,32 @@ async def tao_error(self, ctx, error):
f"Tao is shy, so you can only view him once every 30 seconds. Try again in {round(error.retry_after, 2)} seconds."
)

@commands.command(name="!zookie", aliases=["!zøøkie"])
@commands.cooldown(1, 30, commands.BucketType.user)
async def zookie(self, ctx: commands.Context):
num = random.randint(0, len(zookiePics) - 1)
info = f"Zookie #{num + 1} of {len(zookiePics)}."
pic = zookiePics[num]
zookieResources[pic] += 1
with open("zookieResources", "wb") as f:
pickle.dump(zookieResources, f)
most_common = zookieResources.most_common(2)
if most_common[0][1] != most_common[1][1] and pic == most_common[0][0]:
info += f" HammerBot's favorite Zookie pic! Shown {most_common[0][1]} times."
elif zookieResources[pic] == 1:
info += " First time shown! ^_^"
else:
info += f" Shown {zookieResources[pic]} times."
await ctx.send(info)
await ctx.send(pic)

@zookie.error
async def zookie_error(self, ctx, error):
if isinstance(error, commands.CommandOnCooldown):
await ctx.send(
f"Zookie likes to hide, so you can only view him once every 30 seconds. Try again in {round(error.retry_after, 2)} seconds."
)

@commands.command(name="?gizmo", aliases=["?tao"])
@commands.cooldown(1, 30, commands.BucketType.user)
async def gizmo_or_tao(self, ctx: commands.Context):
Expand Down
4 changes: 4 additions & 0 deletions gizmopics.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,3 +454,7 @@
"https://cdn.discordapp.com/attachments/1158181434662584320/1158182189129797672/PXL_20210817_210128872.jpg?ex=651b50b7&is=6519ff37&hm=829fd1d2314d66969d0226176195cb2db57123b25830d47edd3c21aa5434fc3e&",
"https://cdn.discordapp.com/attachments/1158181434662584320/1158182189981249546/PXL_20210818_214212828.jpg?ex=651b50b8&is=6519ff38&hm=4652ada8273adfc19f9c72ca47a3eac6a1b05dfc9013998a99fb2372a025f46f&",
]

zookiePics = [
"https://cdn.discordapp.com/attachments/1158181434662584320/1158182189981249546/PXL_20210818_214212828.jpg?ex=651b50b8&is=6519ff38&hm=4652ada8273adfc19f9c72ca47a3eac6a1b05dfc9013998a99fb2372a025f46f&",
]

0 comments on commit 6ed032a

Please sign in to comment.