diff --git a/cog_modules/random/cog.py b/cog_modules/random/cog.py index 8d25bcc..781489e 100644 --- a/cog_modules/random/cog.py +++ b/cog_modules/random/cog.py @@ -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): diff --git a/gizmopics.py b/gizmopics.py index 0f16b27..173ade2 100644 --- a/gizmopics.py +++ b/gizmopics.py @@ -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&", +]