Skip to content

Commit

Permalink
fix undefined ares in confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
PartTimeJS committed Sep 2, 2020
1 parent 534d158 commit a414889
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/commands/subscription/pokemon/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ module.exports = (WDR, Functions, Message, Member, advanced) => {
} else {
create.size = 0;
}

create.areas = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);

} else {

create.max_iv = 100;
Expand All @@ -94,8 +91,14 @@ module.exports = (WDR, Functions, Message, Member, advanced) => {
create.min_iv = await Functions.DetailCollect(WDR, Functions, "Minimum IV", Member, Message, null, min_iv_req, create);

create.min_lvl = await Functions.DetailCollect(WDR, Functions, "Minimum Level", Member, Message, null, "Please respond with a value between 0 and " + WDR.Max_Pokemon_Level + " or type 'All'. Type 'Cancel' to Stop.", create);

create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
}
create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
if (create.geotype == "location") {
create.areas = Member.db.location.name;
} else if (create.geotype == "areas") {
create.areas = Member.db.areas;
} else {
create.areas = "All";
}

create.confirm = await Functions.DetailCollect(WDR, Functions, "Confirm-Add", Member, Message, null, "Type 'Yes' or 'No'. Subscription will be saved.", create);
Expand Down
8 changes: 8 additions & 0 deletions src/commands/subscription/pvp/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,15 @@ module.exports = async (WDR, Functions, Message, Member, advanced) => {
// } else {
// create.min_cp = 0;
// }

create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
if (create.geotype == "location") {
create.areas = Member.db.location.name;
} else if (create.geotype == "areas") {
create.areas = Member.db.areas;
} else {
create.areas = "All";
}

create.confirm = await Functions.DetailCollect(WDR, Functions, "Confirm-Add", Member, Message, null, "Type 'Yes' or 'No'. Subscription will be saved.", create);
if (create.confirm === false) {
Expand Down
6 changes: 6 additions & 0 deletions src/commands/subscription/raid/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,14 @@ module.exports = (WDR, Functions, Message, Member, gym_name_array, gym_detail_ar

if (create.gym === 0) {
create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create, gym_name_array, gym_detail_array, gym_collection);
if (create.geotype == "location") {
create.areas = Member.db.location.name;
} else if (create.geotype == "areas") {
create.areas = Member.db.areas;
}
} else {
create.geotype = "city";
sub.areas = "All"
}

create.confirm = await Functions.DetailCollect(WDR, Functions, "Confirm-Add", Member, Message, null, "Type 'Yes' or 'No'. Subscription will be saved.", create, gym_name_array, gym_detail_array, gym_collection);
Expand Down
10 changes: 9 additions & 1 deletion src/commands/subscription/raid/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ module.exports = (WDR, Functions, Message, Member, gym_name_array, gym_detail_ar
for (let s = 0, slen = subscriptions.length; s < slen; s++) {
let choice = s + 1;
let sub_data = subscriptions[s];
sub_data.pokemon_name = WDR.Master.Pokemon[sub_data.pokemon_id] ? WDR.Master.Pokemon[sub_data.pokemon_id].name : "All Raid Bosses";
if (sub_data.pokemon_id < 0) {
if (sub_data.pokemon_id == -1) {
sub_data.pokemon_name = "All Raids & Eggs";
} else if (sub_data.pokemon_id == -2) {
sub_data.pokemon_name = "All Eggs";
}
} else {
sub_data.pokemon_name = WDR.Master.Pokemon[sub_data.pokemon_id] ? WDR.Master.Pokemon[sub_data.pokemon_id].name : "All Raid Bosses";
}
sub_list += "**" + choice + " - " + sub_data.pokemon_name + "**\n";
let data = "";
if (sub_data.gym_id !== 0) {
Expand Down

0 comments on commit a414889

Please sign in to comment.