yGuy / chatgpt-mattermost-bot

A very simple implementation of a service for a mattermost bot that uses ChatGPT in the backend.
MIT License
150 stars 48 forks source link

Fix to work with Mattermost installed in Subpath #19

Closed sh2 closed 1 year ago

sh2 commented 1 year ago

Fix #18

yGuy commented 1 year ago

Thanks - I believe there is even an API to get the websocket url - we should probably use that one instead?

yGuy commented 1 year ago

Please check whether my fix works for you - I think it's the more robust fix (if it works :-)

sh2 commented 1 year ago

Thank you for a more generic solution! There seems to be a slight error in the code. https://github.com/yGuy/chatgpt-mattermost-bot/commit/558f6ca52f461d8a16aa5c310b3a7cb8e6a2a45e

before wsUrl.protocol = wsUrl.protocol === 'https' ? 'wss' : 'ws'

after wsUrl.protocol = wsUrl.protocol === 'https:' ? 'wss' : 'ws'

yGuy commented 1 year ago

D'oh. Thanks. Can you please check again?

sh2 commented 1 year ago

OK. It works fine. Thank you!