I am building a virtual assistant for myself and it feels wrong and ineffective to ask for every command by an individual if like here as example:
WAKE = 'hello'
while True:
print("Mic ready")
text = voice.get_audio()
if WAKE in text:
if "note" in text:
voice.speak("What do you want to note?")
print("What do you want to note?")
text = voice.get_audio()
Vcm.note(text)
else if "timer" in text:
voice.speak("How long is that timer supposed to run?")
print("How long is that timer supposed to run?")
text = voice.get_audio()
Vcm.timer(text)
else:
voice.speak("At your service")
print("At your service")
text = voice.get_audio()
Isn't there an more efficient way to check which command to execute?