mirror of
https://github.com/danbulant/discord.js
synced 2026-07-07 12:11:11 +00:00
Replace awaitResponse on-the-fly callback with dataCallback
I overlooked it previously.
This commit is contained in:
parent
385da190ba
commit
9cfd287020
1 changed files with 2 additions and 5 deletions
|
|
@ -436,7 +436,7 @@ export default class Client extends EventEmitter {
|
||||||
}
|
}
|
||||||
|
|
||||||
// def awaitResponse
|
// def awaitResponse
|
||||||
awaitResponse(msg, toSend = null, options = null, callback = (/*e, newMsg*/) => { }) {
|
awaitResponse(msg, toSend = null, options = null, callback = (/*err, newMsg*/) => { }) {
|
||||||
var ret;
|
var ret;
|
||||||
|
|
||||||
if (toSend) {
|
if (toSend) {
|
||||||
|
|
@ -466,10 +466,7 @@ export default class Client extends EventEmitter {
|
||||||
}
|
}
|
||||||
// (msg) promise
|
// (msg) promise
|
||||||
return ret.then(() => this.internal.awaitResponse(msg))
|
return ret.then(() => this.internal.awaitResponse(msg))
|
||||||
.then(newMsg => {
|
.then(dataCallback(callback), errorCallback(callback));
|
||||||
callback(null, newMsg);
|
|
||||||
return newMsg;
|
|
||||||
}, errorCallback(callback));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setStatusIdle(callback = (/*err, {}*/) => { }) {
|
setStatusIdle(callback = (/*err, {}*/) => { }) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue