Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
# Code written by Mihail and modified by Andrei. It starts here
from random import choice
def GreetingStuff(receiveMess, isFirstMessage, onlyGreeting): # Main function decides if it's the first message and if it's only a greeting
"""Takes the user greeting and prints out a random response"""
UserGreeting = ["hi", "hello", "yo", "harro", "hi", "hello", "yo", "sup"]
BotResponse = ["Hello there!", "Here comes dat boiiiiii!", "Get ready for an epic adventure. It will be legen wait for it... dary, LEGENDARY!!", "Ayyyyyyy", "Sup BOIIIIII!!", "*nods*"]
BotSimpleResponse = ["Hello there!", "*nods*", "Yo", "Hi", "Sup", "*waves*", "*tips fedora*", "*does a little salute*"]
receiveMess.lower()
for word in receiveMess.split():
if onlyGreeting:
return choice(BotResponse)
elif word in UserGreeting or isFirstMessage:
return choice(BotSimpleResponse)
else:
print("Error: From text_recog_all.py, def GreetingStuff: Not the first message or couldn't find a greeting in it.")
return None
def DadJokes(userWantsToHearJoke): # Main function detects if user wants to hear a joke
"""If user wants to hear a joke returns a random joke based on input, otherwise returns a salty phrase"""
CringeyDadJokes = ["\nWhat time did the man go to the dentist?\nTooth hurt-y.\n","\nI'm reading a book about anti-gravity.\nIt's impossible to put down!\n", "\nYou're American when you go into the bathroom,\nand you're American when you come out,\nbut do you know what you are while you're in there? European.\n","\nDid you know the first French fries weren't actually cooked in France?\nThey were cooked in Greece.\n","\nWant to hear a joke about a piece of paper?\nNever mind... it's tearable.\n","\nI just watched a documentary about beavers.\nIt was the best dam show I ever saw!\n","\nA ham sandwich walks into a bar and orders a beer.\nThe bartender says, 'Sorry we dont serve food here.'\n","\nI bought some shoes from a drug dealer.\nI don't know what he laced them with, but I was tripping all day!\n","\nWhen a dad drives past a graveyard:\nDid you know that's a popular cemetery?\nYep, people are just dying to get in there!\n","\nWhy did the invisible man turn down the job offer?\nHe couldn't see himself doing it.\n","\n I used to have a job at a calendar factory but I got the sack because I took a couple of days off.\n"]
noJokeResponse = ["Fine, you lose!", "Huh, someone is in a bad mood.", "You sure?", "Come on they are nice I promice. *crosses fingers behind his back*", "Oo, you think you have better ones?", "Meh, I wasn't in the mood of telling jokes anyway.", "Someone got up from the wrong side of the bed this morning.", "You normie! REEEEE!", "Yeah it's probably for the best,\n my jokes are so good you will want to tear your ears after you hear them so that you can't hear anything after them,\n because they are THAT GOOD!"]
# receiveMess == "yes" or receiveMess == "yeah" or receiveMess == "ye" or receiveMess == "oh god no" or receiveMess == "please no" or receiveMess == "meh" or receiveMess == "no chatbot":
if userWantsToHearJoke:
return choice(CringeyDadJokes)
else:
return choice(noJokeResponse)
# Code written by Mihail and modified by Andrei. It ends here