Fixed condition where key could be string

pull/1507/head
Jacob Hahn 2023-04-15 04:17:00 -04:00
parent 6a93537c42
commit b2d6987cac
1 changed files with 1 additions and 4 deletions

View File

@ -251,11 +251,8 @@ def message_agent(key, message):
# Check if the key is a valid integer
if is_valid_int(key):
agent_response = agents.message_agent(int(key), message)
# Check if the key is a valid string
elif isinstance(key, str):
agent_response = agents.message_agent(key, message)
else:
return "Invalid key, must be an integer or a string."
return "Invalid key, must be an integer."
# Speak response
if cfg.speak_mode: