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

[Bug] Bot fails with HTTP 400 when a username uses special characters #46

Closed yGuy closed 1 year ago

yGuy commented 1 year ago

It seems OpenAI has pretty strict rules for user names. We need to sanitize the names before sending them to OpenAI, so that it will accept the user names.

The bot fails when there is a "." in the user name, e.g.

MichaelH201 commented 1 year ago

"message": "a.b' does not match '^[a-zA-Z0-9_-]{1,64}$' - 'messages.1.name'",