Created
June 23, 2018 02:47
-
-
Save bestdan/f48bc37e1b06d84faf11bc7bbc51ab5c to your computer and use it in GitHub Desktop.
Customer Service bot
This file contains hidden or 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
def cs_service_bot(): | |
welcome_message = """Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or existing customer? | |
\n[1] New Customer | |
\n[2] Existing Customer | |
\n""" | |
response = input(welcome_message) | |
if response == "1": | |
new_customer() | |
elif response == "2": | |
existing_customer() | |
else: | |
print("Sorry, we didn't understand your selection.") | |
return cs_service_bot() | |
def existing_customer(): | |
print("What kind of support do you need?") | |
response = input("[1] Television Support" + "\n[2] Internet Support" + "\n[3] Speak to a support representative.") | |
if response == "1": | |
television_support() | |
elif response == "2": | |
internet_support() | |
elif response == "3": | |
live_rep("support") | |
else: | |
print("Sorry, we didn't understand your selection.") | |
return existing_customer() | |
def new_customer(): | |
print("We're excited to have you join the DNS family, how can we help you?") | |
response = input("""[1] Sign up for service. | |
\n[2] Schedule a home visit. | |
\n[3] Speak to a sales representative.\n""") | |
if response == "1": | |
sign_up() | |
elif response == "2": | |
home_visit() | |
elif response == "3": | |
live_rep("sales") | |
else: | |
print("Sorry, we didn't understand your selection.") | |
return new_customer() | |
def television_support(): | |
print("What is the nature of your problem?") | |
response = input("""[1] I can't access certain channels. | |
\n[2] My picture is blurry. | |
\n[3] I keep losing service. | |
\n[4] Other issues.""") | |
if response == "1": | |
print("Please check the channel lists at DefinitelyNotSinister.com. If the channel you cannot access is there, please contact a live representative.") | |
did_that_help() | |
elif response == "2": | |
print("Please check the channel lists at DefinitelyNotSinister.com. If the channel you cannot access is there, please contact a live representative.") | |
did_that_help() | |
elif response == "3": | |
print("Please check the channel lists at DefinitelyNotSinister.com. If the channel you cannot access is there, please contact a live representative.") | |
did_that_help() | |
elif response == "4": | |
live_rep("support") | |
else: | |
print("Sorry, we didn't understand your selection.") | |
return television_support() | |
def internet_support(): | |
print("What is the nature of your problem?") | |
response = input("""[1] I can't connect to the internet. | |
\n[2] My connection is very slow. | |
\n[3] I can't access certain sites.""") | |
if response == "1": | |
print("Unplug your router, then plug it back in, then give it a good whack, like the Fonz.") | |
did_that_help() | |
elif response == "2": | |
print("Make sure that all cell phones and other peoples computers are not connected to the internet, so that you can have all the bandwidth.") | |
did_that_help() | |
elif response == "3": | |
print("Move to a different region or install a VPN. Some areas block certain sites.") | |
did_that_help() | |
elif response == "4": | |
live_rep("support") | |
else: | |
print("Sorry, we didn't understand your selection.") | |
return internet_support() | |
def live_rep(x): | |
if x == "sales": | |
print("""Please hold while we connect you with a live sales representative.The wait time will be between two minutes and six hours.We thank you for your patience.""") | |
elif x == "support": | |
print("Please hold while we connect you with a live support representative. The wait time will be between two minutes and six hours. We thank you for your patience.") | |
else: | |
print("sorry, what?") | |
return live_rep_prompt() | |
def did_that_help(): | |
print("Did that solve your problem?") | |
response = input("[1] Yes \n[2] No") | |
if response == 1: | |
print("Thank you!") | |
elif response == 2: | |
live_rep_prompt() | |
def live_rep_prompt(): | |
print("Would you like to speak to a live rep or have a home visit?") | |
response_live_rep = input("[1] Live rep \n[2] Home visit") | |
if response_live_rep == 1: | |
live_rep("support") | |
elif response_live_rep == 2: | |
home_visit("support") | |
else: | |
print("Sorry, wut?") | |
return live_rep_prompt() | |
def home_visit_check(): | |
print("What's the purpose of the visit?") | |
response = input("""[1] New service installation. | |
\n[2] Exisitng service repair. | |
\n[3] Location scouting for unserviced region. | |
""") | |
if response == 1: | |
home_visit("new install") | |
elif response == 2: | |
home_visit("support") | |
elif response == 3: | |
home_visit("scout") | |
def home_visit(purpose = "none"): | |
if purpose == "none": | |
home_visit_check() | |
else: | |
print("""Please enter a date below when you are available for a technician to come to your home and """ + purpose) | |
visit_date = input("Visit date: ") | |
print("Wonderful! A technical will come visit you on " + visit_date + ". Please be available between the hours of 1:00 am and 11:00 pm.") | |
return(visit_date) | |
def sign_up(): | |
print("Great choice, friend! We're excited to have you join the DNS family! Please select the package you are interested in signing up for.") | |
response = input(""""[1] Bundle Deal(Internet + Cable) | |
\n[2] Internet | |
\n[3] Cable""") | |
if response == "1": | |
print("You've selected the Bundle Package! Please schedule a home visit and our technician will come and set up your new service.") | |
home_visit("new install") | |
elif response == "2": | |
print("You've selected the Internet Only Package! Please schedule a home visit and our technician will come and set up your new service.") | |
home_visit("new install") | |
elif response == "3": | |
print("You've selected the Cable Only Package! Please schedule a home visit and our technician will come and set up your new service.") | |
home_visit("new install") | |
else: | |
print("Woops, try again") | |
return sign_up() | |
cs_service_bot() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment