Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPDATED COMMAND LIST. Larvis #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import wolframalpha
import os
import sys
import pyjokes

engine = pyttsx3.init('sapi5')

Expand Down Expand Up @@ -74,6 +75,30 @@ def myCommand():
elif 'open gmail' in query:
speak('okay')
webbrowser.open('www.gmail.com')

elif 'open instagram' in query:
webbrowser.get('chrome').open("instagram.com")

elif 'open stackoverflow' in query:
webbrowser.get('chrome').open("stackoverflow.com")

elif 'open gmail' in query:
webbrowser.get('chrome').open("gmail.com")

elif 'open facebook' in query:
webbrowser.get('chrome').open("facebook.com")

elif 'open gaana' in query:
webbrowser.get('chrome').open("gaana.com")

elif 'open whatsapp web' in query:
webbrowser.get('chrome').open("web.whatsapp.com")

elif 'open flipkart' in query:
webbrowser.get('chrome').open("flipkart.com")

elif 'open amazon' in query:
webbrowser.get('chrome').open("amazon.in")

elif "what\'s up" in query or 'how are you' in query:
stMsgs = ['Just doing my thing!', 'I am fine!', 'Nice!', 'I am nice and full of energy']
Expand All @@ -97,10 +122,10 @@ def myCommand():
speak('Email sent!')

except:
speak('Sorry Sir! I am unable to send your message at this moment!')
speak('Sorry Sir! I am unable to send your message at the moment!')


elif 'nothing' in query or 'abort' in query or 'stop' in query:
elif 'nothing' in query or 'abort' in query or 'stop' or 'exit' in query:
speak('okay')
speak('Bye Sir, have a good day.')
sys.exit()
Expand All @@ -119,8 +144,24 @@ def myCommand():
os.system(random_music)

speak('Okay, here is your music! Enjoy!')



elif 'the time' in query:
strTime = datetime.datetime.now().strftime("%H:%M:%S")
speak(f"Sir, the time is {strTime}")

elif "what's your name" in query or "What is your name" in query:
speak("My friends call me Larvis")
print("My friends call me Larvis.")

elif "who made you" in query or "who created you" in query:
speak("I have been created by Ashutosh")

elif 'joke' in query:
speak(pyjokes.get_joke())

elif 'shutdown system' in query:
speak("Hold On a Sec ! Your system is on its way to shut down")
subprocess.call('shutdown / p /f')
else:
query = query
speak('Searching...')
Expand Down