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
parent 1b75d0d243
commit c45fae5c15
3 changed files with 8 additions and 7 deletions

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