Skip to content

Instantly share code, notes, and snippets.

@Fleker
Created August 5, 2019 21:34
Show Gist options
  • Save Fleker/923664f7cef40fd3b65aac41efd243eb to your computer and use it in GitHub Desktop.
Save Fleker/923664f7cef40fd3b65aac41efd243eb to your computer and use it in GitHub Desktop.
Add newest tracks, and help intents
app.intent('New', (conv: Conv) => {
const newestTracks = conv.data.json.tracks.slice(0, 3)
conv.ask('The last three tracks added to Tabletop Audio are: ' +
newestTracks.map(track => track.track_title) +
'. What do you want to listen to?')
conv.ask(new Suggestions(...newestTracks.map(track => track.track_title)))
})
app.intent('Help', (conv: Conv) => {
conv.ask('Tabletop Audio is the premier advertising-free, free-to-use, and user-supported ' +
'ambient game audio site on the Internet. Visit the website to view a complete list of ' +
'tracks. You can also ask me "What are the latest tracks", ask for a specific song like ' +
`${conv.data.json.tracks[0].track_title}, or ask to play music from a genre like ` +
`${conv.data.json.tracks[0].track_genre}. What do you want to do?`)
conv.ask(new BasicCard({
title: 'Tabletop Audio',
image: new Image({
url: 'https://images.tabletopaudio.com/header3.png',
alt: 'Tabletop Audio banner image'
}),
buttons: new Button({
title: 'View website',
url: 'https://tabletopaudio.com'
})
}))
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment