chat-platform 2.0.1 → 2.1.0

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/chat-platform.js +7 -3
  2. package/package.json +1 -1
package/chat-platform.js CHANGED
@@ -191,9 +191,13 @@ const ChatExpress = function(options) {
191
191
  }
192
192
  }
193
193
  if (_.isEmpty(chatId) && !_.isEmpty(userId)) {
194
- chatId = await contextProvider.getChatId(userId, options.transport);
195
- if (_.isEmpty(chatId)) {
196
- throw `Unable to resolve chatId from userId "${userId}" (${options.transport}). That means either the userId "${userId}" doesn't exist or it's not possible to find a valid chatId for the platform ${options.transport}.`;
194
+ if (userId === 'simulator') {
195
+ chatId = 0; // for simulators conventionally set zero
196
+ } else {
197
+ chatId = await contextProvider.getChatId(userId, options.transport);
198
+ if (_.isEmpty(chatId)) {
199
+ throw `Unable to resolve chatId from userId "${userId}" (${options.transport}). That means either the userId "${userId}" doesn't exist or it's not possible to find a valid chatId for the platform ${options.transport}.`;
200
+ }
197
201
  }
198
202
  }
199
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chat-platform",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Universal Chat Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {