Closed taraa62 closed 5 years ago
"@rocket.chat/sdk": "^1.0.0-alpha.28" I use this:
const rocket = { url: "https://rocket.test.online/api/v1/", protocol: true, host: "rocket.test.online", port: 443, user: "bot1", password: "asdfghj", myuserid: "" } process.env.ROCKETCHAT_URL = rocket.url; process.env.ROCKETCHAT_USER = rocket.user; process.env.ROCKETCHAT_PASSWORD = rocket.password; process.env.ROCKETCHAT_USE_SSL = "https"; // const {driver, api, methodCache, settings} = require('@rocket.chat/sdk'); const {Bot, Livechat, Rocketchat, settings} = require('@rocket.chat/sdk'); settings.host = rocket.host; settings.useSsl = true; settings.username = rocket.user; settings.password = rocket.password; createNewPrivateRoom = async (roomName) => { const bot = new Bot({logger: console}); await bot.connect( {host: rocket.host, useSsl: rocket.protocol, useSsl:true } ).catch(er=> console.error) // const log = ss.login({username: rocket.user, password: rocket.password}) // console.log(ss) } createNewPrivateRoom()
But, it don't change host:
[driver] Connecting { host: 'rocket.test.online', timeout: 20000, useSsl: true } [driver] Failed to connect: connect ECONNREFUSED 127.0.0.1:3000 [ddp] Reopen error: connect ECONNREFUSED 127.0.0.1:3000 [driver] Timeout (20000) [ddp] Reopen error: connect ECONNREFUSED 127.0.0.1:3000
"@rocket.chat/sdk": "^1.0.0-alpha.28" I use this:
But, it don't change host: