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.
@@ -68,7 +68,7 @@ async function main() {
68
68
  clearInterval(intervalemote);
69
69
  clearInterval(intervalMove);
70
70
  clearInterval(intervalnameset);
71
- console.log(reason)
71
+ if (reason !== null) console.log(reason);
72
72
  });
73
73
 
74
74
  function findbot2(botName, identitybot) {
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.5",
7
+ "version": "1.0.7",
8
8
  "description": "ddbot.js — это Node.js проект для автоматизации и управления ботами, а также работы с картами и логами.",
9
9
  "main": "./index.js",
10
10
  "scripts": {
11
- "electron": "npx electron ./main-electron.js",
12
- "start": "node main.js",
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) {