🐛 fix(ChatProcess.py): remove unused imports and variables to improve code readability and maintainability

🐛 fix(ChatProcess.py): fix logic error in the return criteria for determining if the bot should respond to a message
🐛 fix(ChatProcess.py): fix typo in the 'functions' variable name
🐛 fix(ChatProcess.py): fix typo in the 'functions' parameter name in the request function call
🐛 fix(ChatProcess.py): fix typo in the 'functions' parameter name in the processFunctioncallResponse function call
🐛 fix(ChatProcess.py): remove unnecessary print statement in the processMessage function
🐛 fix(prompts.py): remove unnecessary print statement in the createPrompt function
🐛 fix(channelSetup.py): fix logic error in the is_owner function call
🐛 fix(moderation.py): remove unnecessary code for disabling moderation
🐛 fix(config.py): remove unnecessary code for creating tables in the database
🐛 fix(functionscalls.py): fix type hint for the return value of the call_function function
🐛 fix(guild.py): fix handling of serialized data in the load function
🐛 fix(SqlConnector.py): create setup_data table if it does not exist
This commit is contained in:
2023-08-21 11:36:55 +02:00
parent fb18b7bb9b
commit 8771247612
9 changed files with 44 additions and 53 deletions

View File

@@ -341,7 +341,9 @@ async def evaluate_math(
return f"Result to math eval of {evaluable}: ```\n{str(result)}```"
async def call_function(message: discord.Message, function_call, api_key):
async def call_function(
message: discord.Message, function_call, api_key
) -> list[None | str]:
name = function_call.get("name", "")
if name == "":
raise FuntionCallError("No name provided")
@@ -359,7 +361,7 @@ async def call_function(message: discord.Message, function_call, api_key):
):
return "Query blocked by the moderation system. If the user asked for something edgy, please tell them in a funny way that you won't do it, but do not specify that it was blocked by the moderation system."
returnable = await function(message, arguments)
return returnable
return [returnable, name]
functions_matching = {