The first issue was caused by the last refactoring, which broke the ability to send direct messages to users.
The second issue arose after fixing the first issue and adding functionality for the bot to monitor all typed content and take appropriate actions in real time:
If the language violates the OpenAI module, a warning message is sent. If not, the content is sent directly to OpenAI for processing and returns an answer.
The problem lies in the latter part, where OpenAI processes direct messages sent between users. For example, "@SomeUsername hello, how are you today?" – The message is sent to the user, but OpenAI also processes the direct message and returns a query after responding to "hello, how are you today?"
Added a typing prompt for when the bot is typing
Did a small bit of refactoring to get the openAi to not listen for DM
Added a new string in the welcome announcement
Also added a switch statement inside onCreateMessage to make it cleaner
Fixed two issues: Fixed two issues:
The first issue was caused by the last refactoring, which broke the ability to send direct messages to users.
The second issue arose after fixing the first issue and adding functionality for the bot to monitor all typed content and take appropriate actions in real time:
The problem lies in the latter part, where OpenAI processes direct messages sent between users. For example, "@SomeUsername hello, how are you today?" – The message is sent to the user, but OpenAI also processes the direct message and returns a query after responding to "hello, how are you today?"