Skip to content

Commit

Permalink
fix(darvo): give darvo the right platform
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Feb 2, 2021
1 parent ad60310 commit c9e3381
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/Worldstate/Darvo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Darvo extends Command {
const platformParam = message.strippedContent.match(this.regex)[1];
const platform = platformParam || ctx.platform;
await this.messageManager.embed(message, new DarvoEmbed(this.bot,
(await this.ws.get('dailyDeals'))[0], platform, ctx.language), true, false);
(await this.ws.get('dailyDeals', platform, ctx.language))[0], platform), true, false);
return this.messageManager.statuses.SUCCESS;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/resources/WorldStateClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class WorldStateClient {

async get(endpoint, platform = 'pc', language = 'en') {
this.logger.silly(`fetching ${endpoint} for ${platform} with lang(${language})`);
return fetch(`${apiBase}/${platform.toLowerCase()}/${endpoint}`, {
return fetch(`${apiBase}/${platform.toLowerCase()}/${endpoint}?language=${language}&platform=${platform}`, {
headers: {
platform,
'Accept-Language': language,
Expand All @@ -20,7 +20,7 @@ class WorldStateClient {

async g(endpoint, platform = 'pc', language = 'en') {
this.logger.silly(`fetching ${endpoint}`);
return fetch(`${apiBase}/${endpoint}?language=${language}`, {
return fetch(`${apiBase}/${endpoint}?language=${language}&platform=${platform}`, {
headers: {
platform,
'Accept-Language': language,
Expand All @@ -35,7 +35,7 @@ class WorldStateClient {

async pricecheck(query, { type = 'attachment', platform = 'pc', language = 'en' }) {
this.logger.silly(`pricechecking ${query}`);
return fetch(`${apiBase}/pricecheck/${type}/${query}`, {
return fetch(`${apiBase}/pricecheck/${type}/${query}?language=${language}&platform=${platform}`, {
headers: {
platform,
'Accept-Language': language,
Expand Down

0 comments on commit c9e3381

Please sign in to comment.