Skip to content

Commit a414889

Browse files
committed
fix undefined ares in confirmation
1 parent 534d158 commit a414889

4 files changed

Lines changed: 31 additions & 6 deletions

File tree

src/commands/subscription/pokemon/create.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ module.exports = (WDR, Functions, Message, Member, advanced) => {
7575
} else {
7676
create.size = 0;
7777
}
78-
79-
create.areas = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
80-
8178
} else {
8279

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

9693
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);
97-
98-
create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
94+
}
95+
create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
96+
if (create.geotype == "location") {
97+
create.areas = Member.db.location.name;
98+
} else if (create.geotype == "areas") {
99+
create.areas = Member.db.areas;
100+
} else {
101+
create.areas = "All";
99102
}
100103

101104
create.confirm = await Functions.DetailCollect(WDR, Functions, "Confirm-Add", Member, Message, null, "Type 'Yes' or 'No'. Subscription will be saved.", create);

src/commands/subscription/pvp/create.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,15 @@ module.exports = async (WDR, Functions, Message, Member, advanced) => {
6060
// } else {
6161
// create.min_cp = 0;
6262
// }
63+
6364
create.geotype = await Functions.DetailCollect(WDR, Functions, "Geofence", Member, Message, null, "Please respond with 'Yes' or 'No'", create);
65+
if (create.geotype == "location") {
66+
create.areas = Member.db.location.name;
67+
} else if (create.geotype == "areas") {
68+
create.areas = Member.db.areas;
69+
} else {
70+
create.areas = "All";
71+
}
6472

6573
create.confirm = await Functions.DetailCollect(WDR, Functions, "Confirm-Add", Member, Message, null, "Type 'Yes' or 'No'. Subscription will be saved.", create);
6674
if (create.confirm === false) {

src/commands/subscription/raid/create.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,14 @@ module.exports = (WDR, Functions, Message, Member, gym_name_array, gym_detail_ar
132132

133133
if (create.gym === 0) {
134134
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);
135+
if (create.geotype == "location") {
136+
create.areas = Member.db.location.name;
137+
} else if (create.geotype == "areas") {
138+
create.areas = Member.db.areas;
139+
}
135140
} else {
136141
create.geotype = "city";
142+
sub.areas = "All"
137143
}
138144

139145
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);

src/commands/subscription/raid/view.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ module.exports = (WDR, Functions, Message, Member, gym_name_array, gym_detail_ar
2323
for (let s = 0, slen = subscriptions.length; s < slen; s++) {
2424
let choice = s + 1;
2525
let sub_data = subscriptions[s];
26-
sub_data.pokemon_name = WDR.Master.Pokemon[sub_data.pokemon_id] ? WDR.Master.Pokemon[sub_data.pokemon_id].name : "All Raid Bosses";
26+
if (sub_data.pokemon_id < 0) {
27+
if (sub_data.pokemon_id == -1) {
28+
sub_data.pokemon_name = "All Raids & Eggs";
29+
} else if (sub_data.pokemon_id == -2) {
30+
sub_data.pokemon_name = "All Eggs";
31+
}
32+
} else {
33+
sub_data.pokemon_name = WDR.Master.Pokemon[sub_data.pokemon_id] ? WDR.Master.Pokemon[sub_data.pokemon_id].name : "All Raid Bosses";
34+
}
2735
sub_list += "**" + choice + " - " + sub_data.pokemon_name + "**\n";
2836
let data = "";
2937
if (sub_data.gym_id !== 0) {

0 commit comments

Comments
 (0)