ddbot.js-0374 3.1.2 → 3.1.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/bot/bot.js +5 -2
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "teeworlds": "^2.5.8"
6
6
  },
7
7
  "name": "ddbot.js-0374",
8
- "version": "3.1.2",
8
+ "version": "3.1.4",
9
9
  "description": "ddbot.js — это Node.js проект для автоматизации и управления ботами, а также работы с картами и логами.",
10
10
  "main": "./index.js",
11
11
  "scripts": {
package/src/bot/bot.js CHANGED
@@ -20,7 +20,7 @@ class BotManager extends EventEmitter {
20
20
  */
21
21
  constructor(teeWorlds = null) {
22
22
  super();
23
- if (typeof teeWorlds === "object") {
23
+ if (teeWorlds !== null && typeof teeWorlds === "object") {
24
24
  this.TW = teeWorlds;
25
25
  } else {
26
26
  this.TW = teeworlds;
@@ -114,8 +114,11 @@ class BotManager extends EventEmitter {
114
114
  logDebug('initializing freeze state');
115
115
  this.botFreezeStates.set(uniqueBotName, false);
116
116
 
117
+ logDebug('bot create done', uniqueBotName)
117
118
  return uniqueBotName;
118
119
  } catch (error) {
120
+ logDebug('error bot create')
121
+ logDebug(error);
119
122
  return null; // не получилось
120
123
  }
121
124
  }
@@ -129,7 +132,7 @@ class BotManager extends EventEmitter {
129
132
  logDebug('connectBot called with botName:', botName); // логируем вызов функции
130
133
  const botInfo = this.getBotInfo(botName); // получаем инфу о боте
131
134
  if (!botInfo) {
132
- logDebug('bot not found')
135
+ logDebug('bot not found');
133
136
  return false; // бот не найден
134
137
  }
135
138
  try {