Fix get order. (#1274)

* Fix get order.

* Fix types.
This commit is contained in:
Alon Schwartzblat 2022-03-02 05:08:27 +02:00 • committed by GitHub
commit c45fae5c15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -487,9 +487,9 @@ class Message extends Base {
*/
async getOrder() {
if (this.type === MessageTypes.ORDER) {
const result = await this.client.pupPage.evaluate((orderId, token) => {
return window.WWebJS.getOrderDetail(orderId, token);
}, this.orderId, this.token);
const result = await this.client.pupPage.evaluate((orderId, token, chatId) => {
return window.WWebJS.getOrderDetail(orderId, token, chatId);
}, this.orderId, this.token, this._getChatId());
if (!result) return undefined;
return new Order(this.client, result);
}