radio-t / super-bot

radio-t bot слушает чат telegram и реагирует на определенные команды и фрагменты текста.
MIT License
63 stars 31 forks source link

Using WTFSteroidChecker in OpenAI bot for request and response #98

Closed ufian closed 1 year ago

ufian commented 1 year ago

Problem Many users are making requests to OpenAI bot with the reason to receive "wtf" response.

Solution Using WTFSteroidChecker for checking request and response to OpenAI bot for "wtf". If it contains, then ban the user for 1 hour

Example

Screenshot 2023-03-24 at 2 44 09 PM

Issue #93

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4556476474


Totals Coverage Status
Change from base Build 4547805015: 0.3%
Covered Lines: 2094
Relevant Lines: 2577

💛 - Coveralls
ufian commented 1 year ago

In this PR I need to provide full msg object to checkRequest and checkResponse methods, but I used only User and Message ID fields.

If we'd support IsReply, then we won't need to provide Message Id inside this checks.

Question: Do you know any good approach how to do universal generation of ban-responses? I may define the lambda and put it as an argument in check functions

ufian commented 1 year ago

Should I squash?

umputun commented 1 year ago

Should I squash?

yes, pls