mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-28 05:31:03 +00:00
fix: addTrainData not being added to the events
This commit is contained in:
@@ -2,7 +2,7 @@ import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import { join } from 'node:path';
|
||||
|
||||
export default function addTrainData(eventData) {
|
||||
const file = readFileSync(join(global.__dirname, global.config.fasttext.trainData), 'utf-8');
|
||||
const file = readFileSync(join(global.__dirname, global.config.fasttext.trainFile), 'utf-8');
|
||||
const data = file.split('\n');
|
||||
const { label, text } = eventData;
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function addTrainData(eventData) {
|
||||
|
||||
data.splice(labelIndex === -1 ? 0 : labelIndex, 0, `${label} ${text}`);
|
||||
|
||||
writeFileSync(join(global.__dirname, global.config.fasttext.trainData), data.join('\n'));
|
||||
writeFileSync(join(global.__dirname, global.config.fasttext.trainFile), data.join('\n'));
|
||||
|
||||
return;
|
||||
}
|
||||
Reference in New Issue
Block a user