fishing-bot-mod/index.js

29 lines
579 B
JavaScript

require('dotenv').config();
globalThis.gBot = require('./src/Bot');
const MPPClient = require('./src/MPPClient');
const db = require('./src/Database');
let sendChat = MPPClient.sendChat;
gBot.start(process.env.MPPCLONE_TOKEN);
process.stdin.on('data', data => {
let str = data.toString().trim();
if(str.length) {
MPPClient.client.sendArray([{
m: 'a',
message: str
}]);
}
});
process.on('SIGINT', async () => {
if (!db.isClosed()) {
await db.close();
}
process.exit();
});