From 68696e25f0f6a7778408244073c6f71ff7e0ef9f Mon Sep 17 00:00:00 2001 From: crate Date: Sun, 4 Jan 2026 06:13:15 -0600 Subject: [PATCH] test smart garf and fix weather error log --- garfmain.py | 5 ++++- garfpy/weather.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/garfmain.py b/garfmain.py index f588acc..150ee7f 100644 --- a/garfmain.py +++ b/garfmain.py @@ -16,7 +16,7 @@ from garfpy import ( ) -gapikey = config.GIF_TOKEN +# gapikey = config.GIF_TOKEN garfkey = config.GARFBOT_TOKEN txtmodel = config.TXT_MODEL imgmodel = config.IMG_MODEL @@ -118,6 +118,9 @@ async def garfbot_weather(ctx, *, location): @garfbot.command(name="chat") async def garfchat(ctx, *, prompt): + if "is this true" in prompt.lower(): + messages = [msg async for msg in ctx.channel.history(limit=2)] + prompt = messages[1].content answer = await garfield.generate_chat(prompt) logger.info( f"Chat Request - User: {ctx.author.name}, Server: {ctx.guild.name}, Prompt: {prompt}" diff --git a/garfpy/weather.py b/garfpy/weather.py index 3bbe16f..a68b55c 100644 --- a/garfpy/weather.py +++ b/garfpy/weather.py @@ -126,7 +126,7 @@ class WeatherAPI: response.raise_for_status() return await response.json() except aiohttp.ClientError as e: - logger.error(f"Error fetching weather data for '{location}'") + logger.error(f"Error fetching weather data for '{location}' - {e}") await ctx.send(f"`Error fetching weather data for '{location}'`") return None -- 2.49.1