From ecc6636e2ec5dbc6be0a456c7d77efc69ceecad6 Mon Sep 17 00:00:00 2001 From: Aesthetic Date: Wed, 8 Jul 2026 18:24:50 -0700 Subject: [PATCH] fix: whoops, text file doesnt support async --- cogs/fun.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/fun.py b/cogs/fun.py index 377d248..7e3a51b 100644 --- a/cogs/fun.py +++ b/cogs/fun.py @@ -40,9 +40,9 @@ async def funfact_cmd(interaction): @discohook.command.slash('randomgif', description='Get a free cool gif from my gifs.') async def randomgif_cmd(interaction): await interaction.response.defer() - async with open("data/gifs.json", "r") as data: + with open("data/gifs.json", "rt") as data: gifs = json.load(data) - await interaction.response.followup(random.choice(gifs) + "\n **heres ur tuff gif**") + await interaction.response.followup(random.choice(gifs) + "\n **heres ur tuff gif**") @discohook.command.slash('dice', description="roll a dice using Discord's roll a dice system.", options=[ discohook.Option.integer('dice_num', "The number of dice", required=True, max_value=10, min_value=1), -- 2.51.2