Beispiel #1
0
 def on_enter_slash(self, event):
     sender_id = event['sender']['id']
     url = find_song('slash songs')
     send_video_template(sender_id, url)
     send_text_message(
         sender_id,
         "Choose another song: slash\ngo back to rock song: go back")
     event['sender']['text'] = ""
     self.go_to_again(event)
Beispiel #2
0
 def on_enter_pink_noise(self, event):
     sender_id = event['sender']['id']
     send_video_template(sender_id,
                         "https://www.youtube.com/watch?v=PQwYh1bTnUs")
     send_text_message(
         sender_id,
         "Choose another song: pink noise\ngo back to rock song: go back")
     event['sender']['text'] = ""
     self.go_to_again(event)
Beispiel #3
0
 def on_enter_one_ok_rock(self, event):
     sender_id = event['sender']['id']
     url = find_song('one ok rock')
     send_video_template(sender_id, url)
     send_text_message(
         sender_id,
         "Choose another song: one ok rock\ngo back to rock song: go back")
     event['sender']['text'] = ""
     self.go_to_again(event)
Beispiel #4
0
 def on_enter_sad(self, event):
     sender_id = event['sender']['id']
     send_text_message(sender_id,
                       "That's too bad\nHere is a song to help you cry")
     url = scrape_song(
         "https://www.youtube.com/playlist?list=PLICIxeiTbvFCGjchFvq4wS7wyAhDw64Db"
     )
     send_video_template(sender_id, url)
     event['postback']['payload'] = ""
     self.go_to_ask_again(event)
Beispiel #5
0
 def on_enter_angry(self, event):
     sender_id = event['sender']['id']
     send_text_message(
         sender_id,
         "You must want to roar now\nHere is a song to help you roar")
     url = scrape_song(
         "https://www.youtube.com/playlist?list=PLICIxeiTbvFDqc6aWYdlf8HJVM6gR4ZsK"
     )
     send_video_template(sender_id, url)
     event['postback']['payload'] = ""
     self.go_to_ask_again(event)
Beispiel #6
0
    def on_enter_study_song(self, event):
        print("I'm entering state2")

        sender_id = event['sender']['id']

        url = find_song('study music')
        send_video_template(sender_id, url)
        send_text_message(sender_id,
                          "Choose another song: study song\ngo back: return")
        event['sender']['text'] = ""
        self.go_to_again(event)
Beispiel #7
0
 def on_enter_great_future(self, event):
     sender_id = event['sender']['id']
     send_text_message(
         sender_id,
         "Now I give you some songs to encourage to improve your life")
     send_video_template(
         sender_id,
         "https://www.youtube.com/watch?v=FOvfM0fe-FE&list=PLICIxeiTbvFD_ox665MtNrU8xGjFccRRv"
     )
     send_text_message(sender_id, "Good Bye~~")
     send_attachment_url(sender_id, 'image',
                         "https://i.imgur.com/u2xo5S0.jpg")
     self.go_back()
Beispiel #8
0
 def on_enter_happy(self, event):
     sender_id = event['sender']['id']
     send_text_message(
         sender_id,
         "That's sound good~ Congratulations\nHere is a song to make you stay in happy"
     )
     url = scrape_song(
         "https://www.youtube.com/playlist?list=PLICIxeiTbvFDIKibqc2cU-zhfX3vxStlU"
     )
     send_video_template(sender_id, url)
     send_button_message(sender_id, "Want another?", [{
         'type': 'postback',
         'title': 'Yes',
         'payload': 'yes'
     }, {
         'type': 'postback',
         'title': 'No',
         'payload': 'no'
     }])
     event['postback']['payload'] = ""