From a281d258efedf8a3bbc3dfab8aba7dd125729c05 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:20:18 +0000 Subject: [PATCH 1/2] apply black & isort --- gizmopics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gizmopics.py b/gizmopics.py index 244124d..0f16b27 100644 --- a/gizmopics.py +++ b/gizmopics.py @@ -418,7 +418,7 @@ "https://cdn.discordapp.com/attachments/1105932220838989834/1276273207376351253/IMG_8135.jpg?ex=66d2d0cc&is=66d17f4c&hm=e319d1f76620aba0a4548dcd3a2b2cc65dcce3fc4a37150364ad651cfc466196&", "https://cdn.discordapp.com/attachments/1105932220838989834/1260753340665561141/IMG_3465.jpg?ex=66d30b4c&is=66d1b9cc&hm=7e067140030de07cbf5c8eb095ec4d1f6f3f5943e9d31baa3746105eb5226606&", "https://cdn.discordapp.com/attachments/1105932220838989834/1260753339621183638/IMG_3468.jpg?ex=66d30b4b&is=66d1b9cb&hm=8cac4b997fdabe7c9746854bc1765814454a36aacd3b9c329458d18d427ce297&", - "https://cdn.discordapp.com/attachments/1105932220838989834/1260753338752958614/IMG_3467.jpg?ex=66d30b4b&is=66d1b9cb&hm=55ed0709e455e0a8c170499d4596665119b047815dde5461f4a79269df093c64&" + "https://cdn.discordapp.com/attachments/1105932220838989834/1260753338752958614/IMG_3467.jpg?ex=66d30b4b&is=66d1b9cb&hm=55ed0709e455e0a8c170499d4596665119b047815dde5461f4a79269df093c64&", ] taoPics = [ From 70f0ff8c735f6e8143edefcc07c20a4b742e9cd6 Mon Sep 17 00:00:00 2001 From: ProbablyButter Date: Mon, 25 Nov 2024 18:06:18 -0800 Subject: [PATCH 2/2] zookie pics --- cog_modules/random/cog.py | 26 ++++++++++++++++++++++++++ gizmopics.py | 4 ++++ 2 files changed, 30 insertions(+) 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&", +]