#discord.js txt file write in
14 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
what
Please try to put your question in a complete sentence and add context to explain what you try to do
client.on('message', function(message) {
if (message.content.startsWith("+" + "sell")) {
var json = JSON.stringify(obj);
const line = fs.readFileSync("sells.txt", "utf8").split("\n").length
let args = message.content.trim().split(/ +/g);;
const link = args.slice(1).join(' ');
const content = `${line} \n${link}`
fs.writeFileSync("sells.txt", JSON.stringify(content));
}});
- This is my code.
2.) Version: Discord.js Version 12
I need help. I want that when running this command like "+sell <@User> <Product>" that in the sells.txt file is in Line 1 "1234566789 <= (user id as example) | product123 <= (the product as example)"
Then when running the command again that in Line 1 is "84183191002 | productABC" and in Line 2 "1234566789 <= (user id as example) | product123 <= (the product as example)"
@waxen crag @tiny jolt
Version 14 has released! Please update at your earliest convenience.
• Update: npm rm discord.js npm i discord.js
• Update guide (use CTRL + F to search for the old method or property)
v12 is unsupported and will soon stop working completely
but my whole code is in v12
It‘s been deprecated for almost two years now