Skip to content

Commit 558f6ca

Browse files
committed
fixes #18 I hope
1 parent 0e79e4e commit 558f6ca

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chatgpt-mattermost-bot",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"private": true,
55
"scripts": {
66
"start": "node ./src/botservice.js"

src/mm-client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ client.setUrl(matterMostURLString)
1515
client.setToken(mattermostToken)
1616

1717
const wsClient = new WebSocketClient();
18-
let matterMostURL = new URL(matterMostURLString);
19-
const wsUrl = `${matterMostURL.protocol === 'https:' ? 'wss' : 'ws'}://${matterMostURL.host}/api/v4/websocket`
18+
const wsUrl = new URL(client.getWebSocketUrl());
19+
wsUrl.protocol = wsUrl.protocol === 'https' ? 'wss' : 'ws'
2020

2121
new Promise((resolve, reject) => {
2222
wsClient.addCloseListener(connectFailCount => reject())
2323
wsClient.addErrorListener(event => { reject(event) })
2424
}).then(() => process.exit(0)).catch(reason => { log.error(reason); process.exit(-1)})
2525

26-
wsClient.initialize(wsUrl, mattermostToken)
26+
wsClient.initialize(wsUrl.toString(), mattermostToken)
2727

2828
module.exports = {
2929
mmClient: client,

0 commit comments

Comments
 (0)