Update Jarvis2_4windows.py

This commit is contained in:
TallGorilla 2021-10-09 12:46:14 +02:00
parent 6b701ce3c7
commit a4bed18e5b

View File

@ -37,57 +37,54 @@ popular_websites = {
def main(search_engine, take_command, debug):
while True:
try:
query = take_command()
query = take_command()
# logic for executing commands without arguments
phrases = {
"what's up": command_whatsup,
"nothing": command_nothing,
"abort": command_nothing,
"stop": command_nothing,
"hello": command_hello,
"bye": command_bye,
"play music": command_play_music,
"unpause": command_unpause_music,
"pause music": command_pause_music,
"stop music": command_stop_music
}
for phrase, command in phrases.items():
if phrase in query:
command()
# logic for executing commands without arguments
phrases = {
"what's up": command_whatsup,
"nothing": command_nothing,
"abort": command_nothing,
"stop": command_nothing,
"hello": command_hello,
"bye": command_bye,
"play music": command_play_music,
"unpause": command_unpause_music,
"pause music": command_pause_music,
"stop music": command_stop_music
}
for phrase, command in phrases.items():
if phrase in query:
command()
# logic for executing commands with arguments
if "wikipedia" in query:
command_wikipedia(speak, debug, query)
# logic for executing commands with arguments
if "wikipedia" in query:
command_wikipedia(speak, debug, query)
elif "open" in query:
command_open(
query,
popular_websites,
debug,
search_engine,
take_command
)
elif "open" in query:
command_open(
query,
popular_websites,
debug,
search_engine,
take_command
)
elif "search" in query:
command_search(query, search_engine)
elif "search" in query:
command_search(query, search_engine)
elif "mail" in query:
command_mail(take_command)
elif "mail" in query:
command_mail(take_command)
elif "change rate" in query:
change_rate(query, take_command)
elif "change rate" in query:
change_rate(query, take_command)
elif "change voice" in query.lower():
change_voice(query, take_command)
elif "change voice" in query.lower():
change_voice(query, take_command)
elif "change volume" in query.lower():
change_volume(query, take_command)
elif "change volume" in query.lower():
change_volume(query, take_command)
speak("Next Command! Sir!")
except Exception:
pass
speak("Next Command! Sir!")
def run():