This commit is contained in:
ChomeNS 2022-11-26 18:44:00 +07:00
parent bac86aede3
commit c50e49dbd4

View file

@ -37,7 +37,7 @@ function inject(bot, _dcclient, config, rl) {
bot.console.log(message.toAnsi());
});
rl.on('line', function(line) {
function handleLine(line) {
try {
if (line.toLowerCase() === '' ||
line.toLowerCase().startsWith(' ')) return;
@ -105,6 +105,12 @@ function inject(bot, _dcclient, config, rl) {
} catch (e) {
bot.console.error(e);
}
}
rl.on('line', handleLine);
bot.once('end', () => {
rl.off('line', handleLine);
});
}