@@ -67,8 +67,7 @@ def func(command):
6767 bot .bot (pyjokes .get_joke ())
6868
6969 elif "google" in command :
70- webbrowser .open ("https://www.google.com" )
71- bot .bot ("Check your default web browser!" )
70+ search .search ()
7271
7372 elif 'time' in command :
7473 now = datetime .datetime .now ()
@@ -83,41 +82,8 @@ def func(command):
8382 elif "prime video" in command :
8483 amazon_prime .amazon_prime ()
8584
86- elif "write note" in command :
87- bot .bot ("What should I write?" )
88- note = write_note .write_note ()
89- file = open ('general.txt' , 'w' )
90- file .write (note )
91-
9285 elif "show notes" in command :
93- bot .bot ("Searching for Notes" )
94- try :
95- file = open ("general.txt" , "r" )
96- bot .bot (file .read ())
97- except FileNotFoundError :
98- bot .bot ("No notes are available." )
99- bot .bot ("Want to create one now?" )
100- q = sr .Recognizer ()
101- t = 0
102- with sr .Microphone () as source :
103- while t == 0 :
104- audio = q .listen (source , phrase_time_limit = 5 )
105- try :
106- res = q .recognize_google (audio )
107- t = 1
108- if "yes" in res :
109- bot .bot ("What should I write?" )
110- file = open ('general.txt' , 'w' )
111- note = write_note .write_note ()
112- file .write (note )
113- print ("A new note is created!" )
114- else :
115- bot .bot ("Okay, exiting the note section" )
116- except :
117- print ('Not understandable' )
118- print ('Try again' )
119- t = 0
120- bot .bot ("A new note is created!" )
86+ notes .main ()
12187
12288 elif "gmail" in command :
12389 bot .bot ("sure, opening gmail" )
@@ -144,7 +110,6 @@ def func(command):
144110 bot .bot ("You have aborted the process. Returning back to previous state" )
145111 main (listen ())
146112
147- # google search
148113 elif 'search' in command :
149114 search .search ()
150115
0 commit comments