From 1b18c9f04893e4056a46b0e6405504885216a08a Mon Sep 17 00:00:00 2001 From: Scritches Date: Sat, 1 Sep 2018 22:21:55 -0400 Subject: [PATCH] Improved error messages for LastFM module. --- modules/lastfm/lastfm.js | 8 ++++---- modules/lastfm/strings.json | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/lastfm/lastfm.js b/modules/lastfm/lastfm.js index 9aa254d..ae8c7ab 100644 --- a/modules/lastfm/lastfm.js +++ b/modules/lastfm/lastfm.js @@ -160,7 +160,7 @@ var lastfm = function(dbot) { })); } else { if(err == 'no_user') { - event.reply('Unknown Last.FM user.'); + event.reply(dbot.t('lfm_unknown')); } else if(err == 'no_listen') { event.reply(dbot.t('no_listen', { 'user': event.user })); } @@ -275,7 +275,7 @@ var lastfm = function(dbot) { }.bind(this)); } else { if(err == 'no_user') { - event.reply('Unknown Last.FM user.'); + event.reply(dbot.t('lfm_unknown')); } else if(err == 'no_listen') { event.reply(dbot.t('no_listen', { 'user': event.user })); } @@ -351,7 +351,7 @@ var lastfm = function(dbot) { } else { if(err == 'no_user') { - event.reply('Unknown LastFM user.'); + event.reply(dbot.t('lfm_unknown')); } else if(err == 'no_listen') { event.reply(dbot.t('no_listen', { 'user': user.currentNick })); } @@ -479,7 +479,7 @@ var lastfm = function(dbot) { })); } else { if(err == 'no_user') { - event.reply('Unknown Last.FM user.'); + event.reply(dbot.t('lfm_unknown')); } else { event.reply('Well something went wrong and I don\'t know what it means'); } diff --git a/modules/lastfm/strings.json b/modules/lastfm/strings.json index 8cf17d4..8ec689a 100644 --- a/modules/lastfm/strings.json +++ b/modules/lastfm/strings.json @@ -28,5 +28,8 @@ }, "lfm_scrobbliest": { "en": "Users with the most played tracks: " + }, + "lfm_unknown": { + "en": "Unknown Last.FM user. Please set your Last.FM user by typing '~set lastfm ' where is your Last.FM username." } }