Skip to content

Commit

Permalink
refactor: Parse response text as JSON in bot.js
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelink committed Jun 3, 2024
1 parent 792b18d commit 627d490
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion discord/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ client.on("interactionCreate", async (interaction) => {
// Acknowledge the interaction to avoid timing out
await interaction.deferReply();

const response = await handleInteraction(userMessage);
let response = await handleInteraction(userMessage);
response = JSON.parse(response.text());

if (response.correction) {
await interaction.editReply(
Expand Down

0 comments on commit 627d490

Please sign in to comment.