Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f77940dff9 | |||
| 68696e25f0 |
@@ -16,7 +16,7 @@ from garfpy import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
gapikey = config.GIF_TOKEN
|
# gapikey = config.GIF_TOKEN
|
||||||
garfkey = config.GARFBOT_TOKEN
|
garfkey = config.GARFBOT_TOKEN
|
||||||
txtmodel = config.TXT_MODEL
|
txtmodel = config.TXT_MODEL
|
||||||
imgmodel = config.IMG_MODEL
|
imgmodel = config.IMG_MODEL
|
||||||
@@ -118,6 +118,9 @@ async def garfbot_weather(ctx, *, location):
|
|||||||
|
|
||||||
@garfbot.command(name="chat")
|
@garfbot.command(name="chat")
|
||||||
async def garfchat(ctx, *, prompt):
|
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)
|
answer = await garfield.generate_chat(prompt)
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Chat Request - User: {ctx.author.name}, Server: {ctx.guild.name}, Prompt: {prompt}"
|
f"Chat Request - User: {ctx.author.name}, Server: {ctx.guild.name}, Prompt: {prompt}"
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ class WeatherAPI:
|
|||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return await response.json()
|
return await response.json()
|
||||||
except aiohttp.ClientError as e:
|
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}'`")
|
await ctx.send(f"`Error fetching weather data for '{location}'`")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user