Skip to content

Commit

Permalink
Fixed a bug where the MAX content response check was not working
Browse files Browse the repository at this point in the history
the code was checking content.length instead of content.response.length
  • Loading branch information
davidecke committed Feb 19, 2023
1 parent 3a08228 commit 3cc5a6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async function main() {
askQuestion(question, interaction, async (content) => {
console.log("Response : " + content.response);
console.log("---------------End---------------");
if (content.length >= process.env.DISCORD_MAX_RESPONSE_LENGTH) {
if (content.response.length >= process.env.DISCORD_MAX_RESPONSE_LENGTH) {
await interaction.editReply({ content: "The answer to this question is very long, so I'll answer by DM." });
splitAndSendResponse(content.response, interaction.user);
} else {
Expand Down

0 comments on commit 3cc5a6d

Please sign in to comment.