development #1

Merged
AllfatherHatt merged 157 commits from development into master 2025-06-14 15:47:26 +02:00
Showing only changes of commit 72171e9ed0 - Show all commits

View File

@ -338,10 +338,11 @@ class ReginaldCog(commands.Cog):
response_data = response.choices[0].message response_data = response.choices[0].message
# 🟢 Check if OpenAI returned a function call # 🟢 Check if OpenAI returned a function call
if response_data.get("function_call"): if hasattr(response_data, "function_call") and response_data.function_call:
function_call = response_data["function_call"] function_call = response_data.function_call
function_name = function_call["name"]
function_args = json.loads(function_call["arguments"]) # Convert JSON string to dict function_name = function_call.name
function_args = json.loads(function_call.arguments) # Convert JSON string to dict
# 🟢 Call the appropriate function # 🟢 Call the appropriate function
if function_name == "set_board": if function_name == "set_board":