ddbot.js-0374 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/examples/main.js +1 -1
- package/package.json +3 -4
- package/src/bot/bot.js +8 -0
package/docs/examples/main.js
CHANGED
package/package.json
CHANGED
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
"neiky-ddracebot.js": "^2.4.0"
|
|
5
5
|
},
|
|
6
6
|
"name": "ddbot.js-0374",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.7",
|
|
8
8
|
"description": "ddbot.js — это Node.js проект для автоматизации и управления ботами, а также работы с картами и логами.",
|
|
9
9
|
"main": "./index.js",
|
|
10
10
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"test": "node main.js"
|
|
11
|
+
"start": "node ./docs/examples/main.js",
|
|
12
|
+
"test": "node ./docs/examples/echo-bot.js"
|
|
14
13
|
},
|
|
15
14
|
"repository": {
|
|
16
15
|
"type": "git",
|
package/src/bot/bot.js
CHANGED
|
@@ -295,6 +295,14 @@ class BotManager extends EventEmitter {
|
|
|
295
295
|
logDebug('_setupBotEvents called for botName:', botName); // логируем вызов функции
|
|
296
296
|
let chatinterval = null; // интервал для чата
|
|
297
297
|
|
|
298
|
+
this.on(`${botName}:disconnected`, (reason) => {
|
|
299
|
+
clearInterval(chatinterval);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
this.on(`${botName}:disconnect`, (reason) => {
|
|
303
|
+
clearInterval(chatinterval);
|
|
304
|
+
});
|
|
305
|
+
|
|
298
306
|
client.on('connection_au_serveur_ddrace', () => { // Шок контент бот зашел на сервер
|
|
299
307
|
const botInfo = this.activeBots.get(botName); // получаем инфу о боте
|
|
300
308
|
if (!botInfo) {
|