mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 04:29:15 +00:00
committed by
GitHub
parent
1b75d0d243
commit
c45fae5c15
4
index.d.ts
vendored
4
index.d.ts
vendored
@@ -716,11 +716,11 @@ declare namespace WAWebJS {
|
|||||||
/**
|
/**
|
||||||
* Gets the order associated with a given message
|
* Gets the order associated with a given message
|
||||||
*/
|
*/
|
||||||
getOrder: () => Order,
|
getOrder: () => Promise<Order>,
|
||||||
/**
|
/**
|
||||||
* Gets the payment details associated with a given message
|
* Gets the payment details associated with a given message
|
||||||
*/
|
*/
|
||||||
getPayment: () => Payment,
|
getPayment: () => Promise<Payment>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ID that represents a message */
|
/** ID that represents a message */
|
||||||
|
|||||||
@@ -487,9 +487,9 @@ class Message extends Base {
|
|||||||
*/
|
*/
|
||||||
async getOrder() {
|
async getOrder() {
|
||||||
if (this.type === MessageTypes.ORDER) {
|
if (this.type === MessageTypes.ORDER) {
|
||||||
const result = await this.client.pupPage.evaluate((orderId, token) => {
|
const result = await this.client.pupPage.evaluate((orderId, token, chatId) => {
|
||||||
return window.WWebJS.getOrderDetail(orderId, token);
|
return window.WWebJS.getOrderDetail(orderId, token, chatId);
|
||||||
}, this.orderId, this.token);
|
}, this.orderId, this.token, this._getChatId());
|
||||||
if (!result) return undefined;
|
if (!result) return undefined;
|
||||||
return new Order(this.client, result);
|
return new Order(this.client, result);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -556,8 +556,9 @@ exports.LoadUtils = () => {
|
|||||||
return (chat.labels || []).map(id => window.WWebJS.getLabel(id));
|
return (chat.labels || []).map(id => window.WWebJS.getLabel(id));
|
||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.getOrderDetail = async (orderId, token) => {
|
window.WWebJS.getOrderDetail = async (orderId, token, chatId) => {
|
||||||
return window.Store.QueryOrder.queryOrder(orderId, 80, 80, token);
|
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||||
|
return window.Store.QueryOrder.queryOrder(chatWid, orderId, 80, 80, token);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.WWebJS.getProductMetadata = async (productId) => {
|
window.WWebJS.getProductMetadata = async (productId) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user