Back to Parent

if body.include? "hi"
  		message = greetings.sample + "I'm ToTo ๐Ÿฐ. I reveal some 'fact' about Suzanne ๐ŸŒท or 'joke' with you all day ๐Ÿ˜‚ or find you some interesting gifs ๐Ÿ‘€"
  	elsif body.include? "who"
  		message = "I am ToTo ๐Ÿฐ, Suzanne's personal concierge ๐Ÿ™‡. Suzanne is a 2nd-yr MDES student at Carnegie Mellon University. You can reply 'fact' to learn more about Suzanne!"
  	elsif body.include? "where"
  		message = "I live somewhere in the Cloud โ˜๏ธ, but Suzanne lives in Pittsburgh ๐ŸŒŽ, a old and rusty town in Pennsylvania."
  	elsif body.include? "when"
  		message = "I was created in Fall 2018 during Programming for Online Prototyping class ๐Ÿ–ฅ! Suzanne was born on July 13, 1990 ๐ŸŽ‚."
  	elsif body.include? "why"
  		message = "I was made to reveal some 'fact' about Suzanne ๐Ÿคน๐Ÿปโ€โ™€๏ธ. I can also 'joke' with you or find you 'gifs' all day, all year."
    elsif body.include? "favorite food"
      message = "Suzanne's favorite food is sushi ๐Ÿฃ. She also like wine ๐Ÿท and sake ๐Ÿถ."
    elsif body.include? "likes"
      message = "Suzanne likes flowers ๐ŸŒน, especially white roses. She also likes shiny little things ๐Ÿ’Ž."
    elsif body.include? "hates"
      message = "Suzanne hates pizza ๐Ÿ•. Oh, she hates nature too โ›ฐ๏ธ. Yes, she really does."
    elsif body.include? "place"
      message = "Suzanne's favorite place is Paris, France โ›ฒ. Next is Kyoto, Japan โ›ฉ๏ธ!"
    elsif body.include? "rombi"
      message = "Rombi is Suzanne's one and only precious puppy ๐Ÿถ. Rombi little poodle who is 3 years old ๐Ÿพ."
    elsif body.include? "what"
  		"You can ask simple questions like 'what', 'who', 'when', 'where', and 'why' to get to know more about me or Suzanne. I can also 'joke' with you or tell you 'fact' about Suzanne ๐ŸŒท. If you'd like to see some gifs, just tell me anything-you will be surprised what I can find for you ๐Ÿคน๐Ÿปโ€โ™€๏ธ."
    elsif body.include? "joke"
  		array_of_lines = IO.readlines("jokes.txt")
  		message = array_of_lines.sample + laugh.sample
  	elsif body.include? "fact"
  		array_of_lines = IO.readlines("facts.txt")
  		message = array_of_lines.sample
  	else
  		results = Giphy.search( body )
      unless results.empty?
        gif = results.sample.fixed_width_downsampled_image.url.to_s
        message = "I chose this gif for your search! Hope you like it ๐Ÿฐ. Powered by Giphy.com."
  	end
end
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0