mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
Revert "feat: Save content from user in messages.log"
This reverts commit 0cc41aee5dab693a4cd00321b798d0dd72972a28.
This commit is contained in:
parent
0cc41aee5d
commit
4b583ecc0c
@ -1,6 +1,4 @@
|
|||||||
const resources = require('../props/resources.json');
|
const resources = require('../props/resources.json');
|
||||||
const fs = require('fs');
|
|
||||||
const path = require('path');
|
|
||||||
const { getStrings } = require('../plugins/checklang.js');
|
const { getStrings } = require('../plugins/checklang.js');
|
||||||
const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
|
const { isOnSpamWatch } = require('../plugins/lib-spamwatch/spamwatch.js');
|
||||||
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
|
const spamwatchMiddleware = require('../plugins/lib-spamwatch/Middleware.js')(isOnSpamWatch);
|
||||||
@ -27,16 +25,4 @@ module.exports = (bot) => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.on('message', (msg) => {
|
|
||||||
const userName = msg.from.first_name;
|
|
||||||
const userId = msg.from.id;
|
|
||||||
const messageText = msg.text;
|
|
||||||
const logMessages = path.resolve(__dirname, '../props/messages.log');
|
|
||||||
const logData = `INFO: User ${userName}, ${userId} sent a command or message with the content: ${messageText}\n`
|
|
||||||
fs.appendFile(logMessages, logData, (err) => {
|
|
||||||
if (err) {
|
|
||||||
console.error('Erro ao gravar no arquivo de log:', err);
|
|
||||||
}});
|
|
||||||
});
|
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user