Skip to content

Tag: node.js

fs.writeFileSync method writing wrong to a text file

I have a problem with my script related to writing to a text file. The logic flow works as follows: I read an entire unformatted text file with fs.readFileSync and pass all the read content to a variable of type string. After that I use the .split to break this text into several parts and keep each part of th…

Discord.js | Chatbot responds to command name

so I’m trying to make a chatbot that sends the message after the user types the prefix and the command name. The command works in general but it seems to also take in the command name. I use a command and event handler btw. This is what it looks like: So when people do a.chat without an arg after that,