fix parseLines function
This commit is contained in:
15
main.js
15
main.js
@@ -166,17 +166,16 @@ function joinVoiceChannel(msg)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read/parse text quotes from the "database"
|
// Read/parse text lines from a file
|
||||||
function parseQuotes(filePath)
|
function parseLines(filePath)
|
||||||
{
|
{
|
||||||
let commands = [];
|
let lines = [];
|
||||||
let data = fs.readFileSync(filePath, 'utf-8');
|
let data = fs.readFileSync(filePath, 'utf-8');
|
||||||
let commandLines = data.toString().split('\n');
|
let splitLines = data.toString().split('\n');
|
||||||
let commandParts;
|
splitLines.forEach(function(line) {
|
||||||
commandLines.forEach(function(line) {
|
|
||||||
if (line.length > 0) {
|
if (line.length > 0) {
|
||||||
commands.push(line);
|
lines.push(line);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return commands;
|
return lines;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user