Skip to content

Discord how do I send a line from a text document and delete the used one afterwards? #23916

Discussion options

You must be logged in to vote

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:

content.split('\n')
// or
content.split('\r\n') // sometimes on Windows…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment