0
if (message.toLowerCase === '$bl') {
    console.log(bannedWords.join(', '))
}

bannedWords is previously defined as bannedWords = data.bannedWords and data.bannedWords is the following array: ["bla1", "bla2", "bla3"] For whatever reason, I cannot get the bannedWords array to send as a log in console. FYI, bannedWords' array is defined awkwardly because there are other commands that add/remove things to the array, which work fine (for now).

1 Answer 1

2

You just forgot to invoke the toLowerCase method. Simply add a () to make it toLowerCase() and it should fix your issue.

Edit: PS, do you need to use message.content? Generally, message is the object while its content property is the actual string.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes it must be message.content.toLowerCase()
Thank you, I'm new to discord.js, and I'm just trying to remember as much as I can. This was a big help, thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.