File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -15,15 +15,15 @@ client.setUrl(matterMostURLString)
1515client . setToken ( mattermostToken )
1616
1717const 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
2121new 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
2828module . exports = {
2929 mmClient : client ,
You can’t perform that action at this time.
0 commit comments