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?
GroupD3/greet_keywords.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 lines (9 sloc)
601 Bytes
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
#made by Ridvan Karaman | |
#sentences the bot will respond with if the user used one of the keywords | |
greet_keywords = ("Hello" , "hello", "Hi" , "hi" , "What's up", "what's up", "Sup", "sup", "How's it going","Howdy", "Yo", "Greetings", "greetings") | |
greet_responces = ["Hello there! ", "Hey" , "Hello to you, too!", "Oh, hi there!", "Look who it is!"] | |
def greet_check(sentence): | |
""" return a greeting responce if the user's input was in any of the keywords""" | |
for word in sentence.words: | |
if word in greet_keywords: | |
return random.choice(greet_responces) | |