diff --git a/modules/profile/config.json b/modules/profile/config.json index 69d84c3..761527b 100644 --- a/modules/profile/config.json +++ b/modules/profile/config.json @@ -10,6 +10,7 @@ "bio": null, "lastfm": null, "steam": null, + "currency": null, "goodreads": null, "favourites": { "colour": null diff --git a/modules/r2rio/r2rio.js b/modules/r2rio/r2rio.js index abfce22..7e57cbe 100644 --- a/modules/r2rio/r2rio.js +++ b/modules/r2rio/r2rio.js @@ -18,15 +18,15 @@ var gmaps = function(dbot) { 'key': this.config.api_key, 'oName': from, 'dName': to, - 'currencyCode': 'GBP' + 'currencyCode': event.rProfile.currency || 'gbp' }, 'json': true }, function(err, response, body) { if(!err && body && _.has(body, 'routes') && _.has(body.routes[0], 'duration') && _.has(body.routes[0], 'indicativePrice')) { var route = body.routes[0]; event.reply('If you left right now, it would take you ' + Math.floor(route.duration / 60) + ' hours and ' + - (route.duration % 60) + ' minutes to get the ' + Math.floor(route.distance) + 'KM from ' + from + ' to ' + to + ', and cost you about £' + - route.indicativePrice.price); + (route.duration % 60) + ' minutes to get the ' + Math.floor(route.distance) + 'KM from ' + from + ' to ' + to + ', and cost you about ' + + route.indicativePrice.price + route.indicativePrice.currency); } else { event.reply('Apparently one cannot get from ' + from + ' to ' + to + ' using public transport. Do you accept the challenge?'); }