Added "what's the current song" for spotify skill
This commit is contained in:
parent
bcc44f9fbd
commit
aa9979e5e0
@ -51,6 +51,7 @@ if __name__ == '__main__':
|
|||||||
# intent_manager.recognise("raconte moi une blague") # WORKING
|
# intent_manager.recognise("raconte moi une blague") # WORKING
|
||||||
# intent_manager.recognise("joue le morceau crazy crazy nights de KISS sur spotify") # WORKING
|
# intent_manager.recognise("joue le morceau crazy crazy nights de KISS sur spotify") # WORKING
|
||||||
# intent_manager.recognise("coupe la musique") # WORKING
|
# intent_manager.recognise("coupe la musique") # WORKING
|
||||||
|
intent_manager.recognise("c'est quoi le nom de cette chanson ?")
|
||||||
|
|
||||||
# start the flask server
|
# start the flask server
|
||||||
app.config['JSON_AS_ASCII'] = False
|
app.config['JSON_AS_ASCII'] = False
|
||||||
|
@ -27,3 +27,14 @@ class SpotifySkill(Skill, metaclass=SkillRegistering):
|
|||||||
def pause_music(self, data):
|
def pause_music(self, data):
|
||||||
spotify.get_spotify().pause_playback()
|
spotify.get_spotify().pause_playback()
|
||||||
print("[INFO INTENT] - Paused music for Spotify")
|
print("[INFO INTENT] - Paused music for Spotify")
|
||||||
|
|
||||||
|
@intent_file_handler("current_song.intent", "CurrentSongSpotifyIntent")
|
||||||
|
def current_song(self, data):
|
||||||
|
current_playback = spotify.get_spotify().current_playback()
|
||||||
|
if current_playback['is_playing']:
|
||||||
|
song_name = current_playback['item']['name']
|
||||||
|
artist = current_playback['item']['artists'][0]['name']
|
||||||
|
|
||||||
|
print(song_name + " from " + artist )
|
||||||
|
|
||||||
|
print("[INFO INTENT] - Current playback : music for Spotify")
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
{{song}} de {{artist}}
|
||||||
|
Ce morceau s'appele {{song}} il est chanté par {{artist}}
|
||||||
|
{{song}} chanté par {{artist}}
|
@ -0,0 +1,5 @@
|
|||||||
|
C'est quoi le nom du morceau actuel
|
||||||
|
On écoute quoi la
|
||||||
|
C'est quoi le titre de la chanson actuelle
|
||||||
|
C'est quoi cette chanson
|
||||||
|
C'est quoi cette musique
|
Reference in New Issue
Block a user