2022-01-13 06:18:06 +01:00
|
|
|
require('dotenv').config();
|
|
|
|
|
|
|
|
globalThis.gBot = require('./src/Bot');
|
|
|
|
|
|
|
|
const MPPClient = require('./src/MPPClient');
|
|
|
|
|
2022-03-19 05:06:42 +01:00
|
|
|
const db = require('./src/Database');
|
2022-01-13 06:18:06 +01:00
|
|
|
|
|
|
|
let sendChat = MPPClient.sendChat;
|
|
|
|
|
|
|
|
gBot.start(process.env.MPPCLONE_TOKEN);
|
2022-01-18 08:01:58 +01:00
|
|
|
|
|
|
|
process.stdin.on('data', data => {
|
|
|
|
let str = data.toString().trim();
|
|
|
|
if(str.length) {
|
|
|
|
MPPClient.client.sendArray([{
|
|
|
|
m: 'a',
|
|
|
|
message: str
|
|
|
|
}]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
process.on('SIGINT', async () => {
|
2022-01-18 23:03:59 +01:00
|
|
|
if (!db.isClosed()) {
|
|
|
|
await db.close();
|
|
|
|
}
|
2022-07-08 02:42:03 +02:00
|
|
|
process.exit();
|
2022-01-18 08:01:58 +01:00
|
|
|
});
|