Enhance response formatting in chat interactions for better clarity
This commit is contained in:
parent
86cb28208d
commit
007a14bf5b
1 changed files with 7 additions and 0 deletions
7
main.py
7
main.py
|
|
@ -92,7 +92,10 @@ class LoviBotClient(discord.Client):
|
||||||
return
|
return
|
||||||
|
|
||||||
if response:
|
if response:
|
||||||
|
response = f"{message.author.name}: {message.content}\n\n{response}"
|
||||||
|
|
||||||
logger.info("Responding to message: %s with: %s", incoming_message, response)
|
logger.info("Responding to message: %s with: %s", incoming_message, response)
|
||||||
|
|
||||||
await message.channel.send(response)
|
await message.channel.send(response)
|
||||||
else:
|
else:
|
||||||
logger.warning("No response from the AI model. Message: %s", incoming_message)
|
logger.warning("No response from the AI model. Message: %s", incoming_message)
|
||||||
|
|
@ -177,6 +180,10 @@ async def ask(interaction: discord.Interaction, text: str) -> None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if response:
|
if response:
|
||||||
|
response = f"`{text}`\n\n{response}"
|
||||||
|
|
||||||
|
logger.info("Responding to message: %s with: %s", text, response)
|
||||||
|
|
||||||
await interaction.followup.send(response)
|
await interaction.followup.send(response)
|
||||||
else:
|
else:
|
||||||
await interaction.followup.send(f"I forgor how to think 💀\nText: {text}")
|
await interaction.followup.send(f"I forgor how to think 💀\nText: {text}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue