-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommand_handler.py
More file actions
39 lines (28 loc) · 1.21 KB
/
command_handler.py
File metadata and controls
39 lines (28 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from utils.text_to_speech import speak
from features import jokes, todo, wikipedia_lookup, reminder, camera, music, google_search, time_date, files
def handle_command(command: str):
if "introduce" in command or "introduction" in command:
speak("Hello, we are team AI Dapt. AI that adapts. ")
elif "joke" in command:
jokes.tell_joke()
elif "to-do" in command or "todo" in command or "to do" in command:
todo.handle_todo(command)
elif "wikipedia" in command:
wikipedia_lookup.search_wikipedia(command)
elif "remind" in command or "reminder" in command:
if "show" in command or "list" in command:
reminder.list_reminders()
else:
reminder.set_reminder(command)
elif "camera" in command or "photo" in command:
camera.take_photo()
elif "play music" in command or "song" in command:
music.play_music(command)
elif "google" in command:
google_search.search(command)
elif "time" in command or "date" in command:
time_date.tell_time()
elif "open" in command or "file" in command:
files.open_file(command)
else:
speak("You said " + command)