Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Returns the user's three most-used artists (aggregate)
- case 'myartists':
- client.query('SELECT artist, COUNT(*) AS COUNT FROM '
- + config.SONG_TABLE + ' WHERE (djid = \''+ data.userid +'\')'
- + ' GROUP BY artist ORDER BY COUNT(*) DESC LIMIT 3',
- function select(error, results, fields) {
- var response = 'The artists I\'ve heard you play the most are: ';
- for (i in results) {
- response += results[i]['artist'] + ': '
- + results[i]['COUNT'] + ' plays. ';
- }
- bot.speak(response);
- });
- break;
Add Comment
Please, Sign In to add comment