Skip to content

Instantly share code, notes, and snippets.

@PinkShellos
Last active February 21, 2019 12:31
Show Gist options
  • Save PinkShellos/55ca408a307aa029b5a7037e8bfe4fe5 to your computer and use it in GitHub Desktop.
Save PinkShellos/55ca408a307aa029b5a7037e8bfe4fe5 to your computer and use it in GitHub Desktop.
A Customer Service Bot for the Definitely Not Sinister Cable Co. for the Programming in Python Codecademy Intensive
#
# Customer Service Bot was a project I worked on for the fictional ISP
# Definitely Not Sinister Cable Company (DNS) for my Python 3 course through Codecademy.
# It was developed in Jupyter Notebook using parameters dictated inside it.
# I have removed the comments from that for clarity, but added comments to
# make the code easier to maintain.
#
# -Vince Mascoli (@paperfixie) 2018
#
#
# Main function
def cs_service_bot():
print("Hello! Welcome to the DNS Cable Company's Service Portal. Are you a new or exisiting customer?")
print("[1] New Customer\n[2] Existing Customer")
customer = input("Please enter the number corresponding with your choice: ")
if customer == "1":
new_customer()
elif customer == "2":
existing_customer()
else:
return "Sorry, we didn't understand your selection."
# Existing customer prompt
def existing_customer():
print("What kind of support do you need?\n[1] Television Support\n[2] Internet Support\n[3] Speak to a support representative.")
selection = input("Please enter the number corresponding with your choice: ")
if selection == "1":
television_support()
elif selection == "2":
internet_support()
elif selection == "3":
live_rep("support")
else:
print("Sorry, we didn't understand your selection.")
existing_customer()
# New customer prompt
def new_customer():
print("We're excited to have you join the DNS family, how can we help you?")
print('[1] Sign up for service.\n[2] Schedule a home visit.\n[3] Speak to a sales representative.')
selection = input("Please enter the number corresponding with your choice: ")
if selection == "1":
sign_up()
elif selection == "2":
home_visit()
elif selection == "3":
live_rep("sales")
else:
print("Sorry, we didn't understand your selection.")
new_customer()
# Television Issue Support
def television_support():
print("What is the nature of your problem?")
print("[1] I can't access certain channels.\n[2] My picture is blurry.\n[3] I keep losing service.\n[4] Other issues.")
selection = input("Please enter the number corresponding with your choice:")
if selection == "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 selection == "2":
print("Try adjusting the antenna above your television set.")
did_that_help()
elif selection == "3":
print("Is it raining outside? If so, wait until it is not raining and then try again.")
did_that_help()
elif selection == "4":
live_rep("support")
else:
print("Sorry, we didn't understand your selection.")
television_support()
# Internet Issue Support
def internet_support():
print("What is the nature of your problem?")
print("[1] I can't connect to the internet.\n[2] My connection is very slow.\n[3] I can't access certain sites.\n[4] Other Issues")
selection = input("Please enter the number corresponding with your choice:")
if selection == "1":
print("Unplug your router, then plug it back in, then give it a good whack, like the Fonz.")
did_that_help()
elif selection == "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 selection == "3":
print("Move to a different region or install a VPN. Some areas block certain sites.")
did_that_help()
elif selection == "4":
live_rep("support")
else:
print("Sorry, we didn't understand your selection.")
internet_support()
# Confirm is if issues are resolved
def did_that_help():
confirm_helped = input("Did this solution resolve your problem? [Y]/[N]: ")
if confirm_helped == "Y":
return "Thank you for being a part of the DNS Cable Family!"
elif confirm_helped == "N":
more_help()
else:
print("Sorry, we didn't understand your selection.")
did_that_help()
# Secondary support prompt
def more_help():
print("How can we further assist you?")
print("[1] Speak to a representative\n[2] Schedule a home visit\n[3] Return to previous menu")
need_more_help = input("Please enter the number corresponding with your choice: ")
if need_more_help == "1":
live_rep("support")
elif need_more_help == "2":
home_visit("support")
elif need_more_help == "3":
did_that_help()
else:
print("Sorry, we didn't understand your selection.")
more_help()
# Sign up for new service
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.")
print("[1] Bundle Deal (Internet + Cable)\n[2] Internet\n[3] Cable")
selection = input("Please enter the number corresponding with your choice: ")
if selection == "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 selection == "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 selection == "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("Sorry, we didn't understand your selection.")
sign_up()
# Schedule home visit
def home_visit(purpose):
if purpose == "none":
print("For what reason would you like to schedule this home visit?")
print("[1] New service installation.\n[2] Existing service repair.\n[3] Location scouting for unserviced region.")
selection = input("Please enter the number corresponding with your choice: ")
if selection == "1":
home_visit("new install")
elif selection == "2":
home_visit("support")
elif selection == "3":
home_visit("scout")
else:
print("Sorry, we didn't understand your selection.")
home_visit()
elif purpose == "new install":
visit_date = input("Please enter a date below when you are available for a technician to come to your home and install your new service:\n")
print("Wonderful! A technician will come visit you on " + visit_date + ". Please be available between the hours of 1:00 am and 11:00 pm.")
elif purpose == "support":
visit_date = input("Please enter a date below when you are available for a technician to come to your home and repair your existing service:\n")
print("Wonderful! A technician will come visit you on " + visit_date + ". Please be available between the hours of 1:00 am and 11:00 pm.")
elif purpose == "scout":
visit_date = input("Please enter a date below when you are available for a technician to come to your home and scout your location for service:\n")
print("Wonderful! A technician will come visit you on " + visit_date + ". Please be available between the hours of 1:00 am and 11:00 pm.")
else:
print("Sorry, we didn't understand your selection.")
home_visit()
# Speak to live representative
def live_rep(purpose):
if purpose == "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 purpose == "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.")
# Call Customer Service Bot function
cs_service_bot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment