mirror of
https://github.com/reality/dbot.git
synced 2025-01-11 20:42:37 +01:00
strings for lastfm
This commit is contained in:
parent
93b751af29
commit
1c1ba2ef02
@ -30,12 +30,20 @@ var lastfm = function(dbot) {
|
|||||||
} else if(_.has(body, 'recenttracks') && !_.isUndefined(body.recenttracks.track[0])) {
|
} else if(_.has(body, 'recenttracks') && !_.isUndefined(body.recenttracks.track[0])) {
|
||||||
var track = body.recenttracks.track[0];
|
var track = body.recenttracks.track[0];
|
||||||
if(_.has(track, '@attr') && _.has(track['@attr'], 'nowplaying') && track['@attr'].nowplaying == 'true') {
|
if(_.has(track, '@attr') && _.has(track['@attr'], 'nowplaying') && track['@attr'].nowplaying == 'true') {
|
||||||
event.reply(event.user + ' is listening to ' + track.name + ' by ' + track.artist['#text']);
|
event.reply(dbot.t('now_listening', {
|
||||||
|
'user': event.user,
|
||||||
|
'track': track.name,
|
||||||
|
'artist': track.artist['#text']
|
||||||
|
}));
|
||||||
} else {
|
} else {
|
||||||
event.reply(event.user + ' last listened to ' + track.name + ' by ' + track.artist['#text']);
|
event.reply(dbot.t('last_listened', {
|
||||||
|
'user': event.user,
|
||||||
|
'track': track.name,
|
||||||
|
'artist': track.artist['#text']
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
event.reply(event.user + ' isn\'t listening to anything right now :\'(');
|
event.reply(dbot.t('no_listen', { 'user': event.user }));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
11
modules/lastfm/strings.json
Normal file
11
modules/lastfm/strings.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"now_listening": {
|
||||||
|
"en": "{user} is listening to {track} by {artist}"
|
||||||
|
},
|
||||||
|
"last_listened": {
|
||||||
|
"en": "{user} last listened to {track} by {artist}"
|
||||||
|
},
|
||||||
|
"no_listen": {
|
||||||
|
"en": "{user} doesn't seem to have listened to anything recently :'("
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user