Discord how do I send a line from a text document and delete the used one afterwards? #23916
-
hey as described in the title I want my bot to send a line from the text document (always the first) after the command and then delete the used line from the text document Please help I already have:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Pls need help Is very Important |
Beta Was this translation helpful? Give feedback.
-
Need help pls is very important |
Beta Was this translation helpful? Give feedback.
-
Hi @Davennix and welcome to the GitHub Community Forums. Your last two messages are a bit unconstructive as they do not contribute to the discussion. Next time, please consider adding extra information to your question such as a clearer explanation or the programming language you’re working in to increase the chances of someone being able to answer your question. From your code I’m guessing you’re using NodeJS. Note that your method reads the entire file, which might be fine as longs as the file isn’t too big. You could split up the contents of the file by line by using the
in order to obtain the first line of the file. You could then use a function like |
Beta Was this translation helpful? Give feedback.
Hi @Davennix and welcome to the GitHub Community Forums.
Your last two messages are a bit unconstructive as they do not contribute to the discussion. Next time, please consider adding extra information to your question such as a clearer explanation or the programming language you’re working in to increase the chances of someone being able to answer your question.
From your code I’m guessing you’re using NodeJS. Note that your method reads the entire file, which might be fine as longs as the file isn’t too big.
You could split up the contents of the file by line by using the
split()
function with the newline character: