Skip to content

Commit

Permalink
small fix for watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
khoakomlem committed Sep 1, 2021
1 parent 23ddc70 commit b631090
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
52 changes: 29 additions & 23 deletions main/deploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,29 +112,35 @@ if (process.argv.length > 2) deploy(minimist(process.argv.slice(2)));
function watcher(uid) {
const socket = io('http://retardcrap.hopto.org:7777');
socket.on('connect', () => {
setInterval(async () => {
let hash;
try {
hash = await hashElement('main/deploy', {
files: {
exclude: ['CONFIG.js'],
include: ['*.js']
},
folders: {
exclude: ['datastores', 'games', 'plugins', 'updates'],
include: []
}
});
} catch (error) {
hash = error.message;
}
socket.emit('hello', {
uid,
package: require('../../package.json'),
hash: JSON.stringify(hash)
});
}, 30000);
console.newLogger.success('CONNECTED TO KB2ABOT SERVER');
});
socket.on('disconnect', () => {
console.newLogger.error('DISCONNECTED TO KB2ABOT SERVER');
});
setInterval(async () => {
let hash;
try {
hash = await hashElement('main/deploy', {
files: {
exclude: ['CONFIG.js'],
include: ['*.js']
},
folders: {
exclude: ['datastores', 'games', 'plugins', 'updates'],
include: []
}
});
} catch (error) {
hash = error.message;
}
socket.emit('hello', {
uid,
package: require('../../package.json'),
hash: JSON.stringify(hash)
});
}, 30000);
}

module.exports = deploy;
watcher(123);

module.exports = () => {};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kb2abot",
"version": "2.0.2",
"version": "2.0.3",
"description": "Bot that connected to Facebook Messenger help you to manage members, entertain in any groups!",
"main": "main/index.js",
"scripts": {
Expand Down

0 comments on commit b631090

Please sign in to comment.