Rocket.Chat.js.SDK
Rocket.Chat.js.SDK copied to clipboard
Creating bot
Hi, I tried creating a bot with the tutorial at: https://developer.rocket.chat/bots/creating-your-own-bot-from-scratch/develop-a-rocket.chat-sdk-bot. The bot keeps trying to connect, and it produces this:
[connect] Connecting {
username: 'bot',
password: 'pass',
ldap: false,
host: 'localhost',
useSsl: 'false',
timeout: 20000,
rooms: [],
allPublic: false,
dm: false,
livechat: false,
edited: false,
integrationId: 'js.SDK',
roomCacheMaxSize: 10,
roomCacheMaxAge: 300000,
dmCacheMaxSize: 10,
dmCacheMaxAge: 100000
}
[connect] Timeout (20000)
/home/jerryberry12/hopebot/node_modules/@rocket.chat/sdk/dist/lib/driver.js:94
const err = new Error('Asteroid connection timeout');
^
Error: Asteroid connection timeout
at Timeout._onTimeout (/home/jerryberry12/hopebot/node_modules/@rocket.chat/sdk/dist/lib/driver.js:94:25)
at listOnTimeout (node:internal/timers:573:17)
at process.processTimers (node:internal/timers:514:7)
Node.js v19.8.1
In my server.js file, all the settings, bot info and passwords are correct. It seems like some default settings are being applied because of this:
[connect] Connecting {
username: 'bot',
password: 'pass',
I set these fields correctly in server.js, not bot and pass. Can some one help me?
Server info
I'm using Raspbian 10 Lite, on a raspberry pi. I installed rocketchat.sdk as shown in the tutorial.
Hi, I have the same problem. The snippet provided in the rocket.chat site is not working and it is throwing the same timeout exception on the line:
await driver.connect({ host: HOST, useSsl: SSL })
I already double checked that the HOST and SSL var are corrected setted.
I managed to get it to work. 🙌
Despite my rocket chat is using https, when I used the SSL = true
, I got the timeout. But, when i use SSL = false
I managed to connect to the rocket.chat instance.
hmm. I was already using SSL = false. you can see my config above. I'll try setting to true
Nope both ways doesn't work Lemme try botpress, since I just got support for that connecter by updating software to v6.
@JerryBerry12 if rocketchat sdk version is 0.2.9-2 must use node 16 else must use node >=18 fot fix a 'Asteroid connection timeout' use this
export NODE_TLS_REJECT_UNAUTHORIZED=0 - Mac
set NODE_TLS_REJECT_UNAUTHORIZED=0 - windows
export NODE_TLS_REJECT_UNAUTHORIZED=0 - linux
Nope both ways doesn't work
You should try setting it to ''