Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
chatBot/what.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25 lines (23 sloc)
1.08 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from wiki import wikiSearch | |
from chatmaths import entre | |
from info import informations, ownInfo | |
""" prepered answers to what questions """ | |
def sentence_what(sentence): | |
""" Function to get ChatBot information related to WHAT questions """ | |
if "your" in sentence: | |
if "last name" in sentence: | |
answer = ["My last name is Foreigners", "My last name is B", "My last name is C", "My last name is D"] | |
print(random.choice(answer)) | |
elif "middle name" in sentence: | |
print("My middle names are Made By The") | |
elif "full name" in sentence: | |
print("My name is ChatBot Made By The Foreigners") | |
elif "name" in sentence: | |
print("My name is ChatBot") | |
else: | |
informations(sentence) #calls other answers about the chatbot | |
elif "my" in sentence: | |
ownInfo(sentence) #calls other questions and answers about the user | |
else: | |
wikiSearch(sentence) #if there are no "personal" questions, calls wikiSearch to search in wikipedia for meanings |