Skip to content

Commit b31fd2b

Browse files
committed
✨ feat: EXPERIMENTAL editMessage #3058
1 parent 392c4da commit b31fd2b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/api/Client.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ declare module WAPI {
179179
chatId: string
180180
) => Promise<boolean>;
181181
const getBusinessProfilesProducts: (to: string) => Promise<any>;
182+
const editMessage: (messageId: string, text: string) => Promise<any>;
182183
const getCommunityInfo: (groupId: string) => Promise<any>;
183184
const getCommunityAdminIds: (groupId: string) => Promise<any>;
184185
const getCommunityAdmins: (groupId: string) => Promise<any>;
@@ -1512,6 +1513,25 @@ public async testCallback(callbackToTest: SimpleListener, testData: any) : Prom
15121513
) as Promise<boolean | MessageId>;
15131514
}
15141515

1516+
1517+
/**
1518+
* NOTE: This is experimental, most accounts do not have access to this feature in their apps.
1519+
*
1520+
* Edit an existing message
1521+
*
1522+
* @param messageId The message ID to edit
1523+
* @param text The new text content
1524+
* @returns
1525+
*/
1526+
public async editMessage(messageId: MessageId, text: Content) : Promise<boolean | MessageId> {
1527+
return await this.pup(
1528+
({ messageId, text }) => {
1529+
return WAPI.editMessage(messageId, text);
1530+
},
1531+
{ messageId, text }
1532+
) as Promise<boolean | MessageId>;
1533+
}
1534+
15151535
/**
15161536
* [UNTESTED - REQUIRES FEEDBACK]
15171537
* Sends a payment request message to given chat

0 commit comments

Comments
 (0)