deleted comments + moved stuff around

This commit is contained in:
array-in-a-matrix 2022-08-23 13:50:21 -04:00
parent 0e867ebbc6
commit 0448eecdb6
1 changed files with 4 additions and 5 deletions

View File

@ -10,20 +10,19 @@ const pyFile = "textgen.py";
AutojoinRoomsMixin.setupOnClient(client);
client.start().then(() => console.log(`Client has started!\n`));
// let messageCounter = 0;
const messageCounters = new Map(); // room ID, message count
let trainingCounter = 0;
client.on("room.message", (roomId, event) => {
if (!event["content"] || event["sender"] === config.user) return;
// ++messageCounter;
messageCounters.set(roomId, (messageCounters.get(roomId) ?? 0) + 1);
console.log(`COUNTER:\t${messageCounters.get(roomId)}\t${roomId}`);
++trainingCounter;
messageCounters.set(roomId, (messageCounters.get(roomId) ?? 0) + 1);
let userMessage = event["content"]["body"].split(" ");
console.log(`COUNTER:\t${messageCounters.get(roomId)}\t${roomId}\t${userMessage}`);
if (userMessage[0].startsWith(config.prefix)) {
userMessage[0] = userMessage[0].replace(config.prefix, '').toLowerCase();
} else {