mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🐛 fix(makeprompt.py): import Hasher class from src.utils.misc to resolve NameError
🔒 chore(makeprompt.py): add user hashing to prevent abuse and enable user banning if necessary
This commit is contained in:
@@ -6,7 +6,7 @@ import datetime
|
||||
import json
|
||||
|
||||
from src.config import curs_data, max_uses, curs_premium, gpt_3_5_turbo_prompt
|
||||
from src.utils.misc import moderate, ModerationError
|
||||
from src.utils.misc import moderate, ModerationError, Hasher
|
||||
from src.utils.openaicaller import openai_caller
|
||||
from src.functionscalls import (
|
||||
call_function,
|
||||
@@ -131,6 +131,7 @@ async def chatgpt_process(
|
||||
messages=msgs,
|
||||
functions=called_functions,
|
||||
function_call="auto",
|
||||
user=Hasher(str(message.author.id)), #for user banning in case of abuse
|
||||
)
|
||||
response = response["choices"][0]["message"] # type: ignore
|
||||
if response.get("function_call"):
|
||||
|
||||
Reference in New Issue
Block a user