Guest User

Untitled

a guest
May 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //Returns the user's three most-used artists (aggregate)
  2. case 'myartists':
  3. client.query('SELECT artist, COUNT(*) AS COUNT FROM '
  4. + config.SONG_TABLE + ' WHERE (djid = \''+ data.userid +'\')'
  5. + ' GROUP BY artist ORDER BY COUNT(*) DESC LIMIT 3',
  6. function select(error, results, fields) {
  7. var response = 'The artists I\'ve heard you play the most are: ';
  8. for (i in results) {
  9. response += results[i]['artist'] + ': '
  10. + results[i]['COUNT'] + ' plays. ';
  11. }
  12. bot.speak(response);
  13. });
  14. break;
Add Comment
Please, Sign In to add comment