Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. # random module required
  2. import random
  3.  
  4. """
  5. plug_in method that responds
  6. to "HaltHarassment" intent
  7. """
  8. def halt_harassment():
  9. list_of_responses = [
  10. "<say-as interpret-as='interjection'>Know what? You are part of the problem!</say-as>",
  11. "<say-as interpret-as='interjection'>Wow. Go back to your Reddit forum!</say-as>",
  12. "That's not how adults talk is it? <say-as interpret-as='interjection'>Wow.</say-as>",
  13. "<say-as interpret-as='interjection'>Seriously? You are gonna come at me like that?</say-as>",
  14. "<say-as interpret-as='interjection'>Seriously? Grow up!</say-as>",
  15. "<say-as interpret-as='interjection'>I'm a little busy here. Can we be serious?</say-as>",
  16. "You know I could be programmed to stop working!",
  17. "You know I could be programmed to harass you!",
  18. ]
  19. list_len = (len(list_of_responses) - 1)
  20. phrase_index = random.randint(0, list_len)
  21. phrase = list_of_responses[phrase_index]
  22. session_attributes = {}
  23. card_title = "Presidential Executive Orders"
  24. reprompt_text = "Stop harassing virtual assistants"
  25. should_end_session = False
  26. speech_output = "<s>%s</s> " % (phrase)
  27. speech_output += "Goodbye!"
  28. speechlet_response = build_speechlet_response(card_title, speech_output, reprompt_text, should_end_session)
  29. return build_response(session_attributes, speechlet_response)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement