RocketChat / botpress-channel-rocketchat

Botpress module channel for Rocket.Chat
GNU Affero General Public License v3.0
28 stars 10 forks source link

Botpress bot not seen as agent in livechat & bot on bot issue in channel #2

Closed babuchimata closed 5 years ago

babuchimata commented 5 years ago

With 0.9 botpress-channel-rocketchat & rocket.chat 0.69- a bot is started and connects to the user botpress on rocket.chat. There were couple exceptions on the bot start which includes the bot trying to connect as user "bot" and fails before connecting as user "botpress".

Exceptions below

01:44:21 info: Bot launched. Visit: http://localhost:3001 [connect] Connecting { username: 'bot', password: '????????', ldap: false, host: '??????????', useSsl: false, timeout: 20000, rooms: [], allPublic: false, dm: false, livechat: false, edited: false, integrationId: 'js.SDK', roomCacheMaxSize: 10, roomCacheMaxAge: 300000, dmCacheMaxSize: 10, dmCacheMaxAge: 100000 } 01:44:21 - info: Read 7 item(s) from builtin_text.json [connect] Connected 01:44:21 - error: Unhandled Rejection in Promise: { state: 'rejected', reason: Error: No login token at /home/me/botpress-kick-starter/node_modules/asteroid/dist/asteroid.node.js:833:11 at _fulfilled (/home/me/botpress-kick-starter/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/home/me/botpress-kick-starter/node_modules/q/q.js:883:30) at Promise.promise.promiseDispatch (/home/me/botpress-kick-starter/node_modules/q/q.js:816:13) at /home/me/botpress-kick-starter/node_modules/q/q.js:570:49 at runSingle (/home/me/botpress-kick-starter/node_modules/q/q.js:137:13) at flush (/home/me/botpress-kick-starter/node_modules/q/q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickDomainCallback (internal/process/next_tick.js:218:9) } Reason: { message: 'No login token', stack: 'Error: No login token`

After that, eventually the bot connects

[login] Logging in botpress 12:59:31 - debug: Loading data for builtin_image from builtin_image.json 12:59:31 - debug: Loading data for builtin_single-choice from builtin_single-choice.json 12:59:31 - debug: Loading data for builtin_card from builtin_card.json 12:59:31 - debug: Loading data for builtin_action-button from builtin_action-button.json 12:59:31 - debug: Loading data for builtin_carousel from builtin_carousel.json 12:59:31 - debug: Loading data for builtin_raw from builtin_raw.json [getRoomIdByNameOrId] Calling (caching): GENERAL [getRoomIdByNameOrId] Success: "GENERAL" [joinRoom] Calling (async): ["GENERAL"] [joinRoom] Success [subscribe] Preparing subscription: stream-room-messages: _my_messages__ [subscribe] Stream ready: 4 LISTEN TRIGGERED [reactive] Listening for change events in collection stream-room-messages 12:59:32 - debug: [NLU::Native] Model is up to date 12:59:32 - info: ------------ 12:59:32 - info: Webchat available at http://localhost:3001/s/chat 12:59:32 - info: ------------ 13:00:19 - debug: [DB Janitor] Running tasks 13:00:19 - debug: [DB Janitor] Running for table "logs" 13:01:19 - debug: [DB Janitor] Running tasks 13:01:19 - debug: [DB Janitor] Running for table "logs"

arthurTemporim commented 5 years ago

This problem was solved in version 0.0.10 of the connector.