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

Added jokes and wikipedia module #39

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
11 changes: 9 additions & 2 deletions asis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
import bs4 as bs
import urllib.request
import requests

import pyjokes
import wikipedia
class person:
name = ''
def setName(self, name):
Expand Down Expand Up @@ -90,6 +91,12 @@ def respond(voice_data):
if there_exists(["what is my name"]):
engine_speak("Your name must be " + person_obj.name)

if there_exists("Tell me a joke"):
engine_speak(pyjokes.get_joke())
if there_exists("Wiki"):
cmd = voice_data.replace("Wiki","")
engine_say(wikipedia.summary(cmd,1))
print(wikipedia.summary(cmd,1))
if there_exists(["your name should be"]):
asis_name = voice_data.split("be")[-1].strip()
engine_speak("okay, i will remember that my name is " + asis_name)
Expand Down Expand Up @@ -208,7 +215,7 @@ def respond(voice_data):
myScreenshot = pyautogui.screenshot()
myScreenshot.save('D:/screenshot/screen.png')


#14 to search wikipedia for definition
if there_exists(["definition of"]):
definition=record_audio("what do you need the definition of")
Expand Down