bancho.js 0.12.2 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitlab-ci.yml +2 -0
- package/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/lib/BanchoUser.js +4 -0
- package/package.json +1 -1
- package/tests/units/WhereUnit.js +7 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -15,6 +15,7 @@ eslint:
|
|
|
15
15
|
|
|
16
16
|
irc:
|
|
17
17
|
stage: test
|
|
18
|
+
resource_group: irc
|
|
18
19
|
script:
|
|
19
20
|
- npm config set script-shell "/bin/bash"
|
|
20
21
|
- npm i
|
|
@@ -23,6 +24,7 @@ irc:
|
|
|
23
24
|
|
|
24
25
|
irc-with-weak-value-map:
|
|
25
26
|
stage: test
|
|
27
|
+
resource_group: irc
|
|
26
28
|
script:
|
|
27
29
|
- npm config set script-shell "/bin/bash"
|
|
28
30
|
- npm i
|
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://nodei.co/npm/bancho.js/)
|
|
4
4
|
[](https://git.cartooncraft.fr/ThePooN/bancho.js/commits/master)
|
|
5
5
|
|
|
6
|
-
## Current release: 0.12.
|
|
6
|
+
## Current release: 0.12.3
|
|
7
7
|
|
|
8
8
|
# Introduction
|
|
9
9
|
|
package/lib/BanchoUser.js
CHANGED
|
@@ -201,6 +201,10 @@ class BanchoUser extends EventEmitter {
|
|
|
201
201
|
reject(new Error("User is offline"));
|
|
202
202
|
return afterAnswer();
|
|
203
203
|
}
|
|
204
|
+
if(message.message == "The user's location could not be determined.") {
|
|
205
|
+
reject(new Error("User's location could not be determined"));
|
|
206
|
+
return afterAnswer();
|
|
207
|
+
}
|
|
204
208
|
const m = answerRegex.exec(message.message);
|
|
205
209
|
if(m && m[1] == this.ircUsername) {
|
|
206
210
|
resolve(m[2]);
|
package/package.json
CHANGED
package/tests/units/WhereUnit.js
CHANGED
|
@@ -9,7 +9,13 @@ class WhereUnit extends TestUnit {
|
|
|
9
9
|
|
|
10
10
|
run() {
|
|
11
11
|
return new Promise((resolve, reject) =>
|
|
12
|
-
this.client.getSelf().where()
|
|
12
|
+
this.client.getSelf().where()
|
|
13
|
+
.then(() => resolve(this.fulFillGoal(TestGoals.Where)))
|
|
14
|
+
.catch((err) => {
|
|
15
|
+
if(err && err.message === "User's location could not be determined")
|
|
16
|
+
return resolve(this.fulFillGoal(TestGoals.Where));
|
|
17
|
+
reject(err);
|
|
18
|
+
})
|
|
13
19
|
);
|
|
14
20
|
}
|
|
15
21
|
}
|