mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-17 19:26:20 +00:00
[FIX] Implement setDescription and setSubject for groups (close #6)
This commit is contained in:
@@ -86,7 +86,7 @@ class GroupChat extends Chat {
|
||||
*/
|
||||
async setSubject(subject) {
|
||||
let res = await this.client.pupPage.evaluate((chatId, subject) => {
|
||||
return Store.Chat.get(chatId).setSubject(subject);
|
||||
return Store.Wap.changeSubject(chatId, subject);
|
||||
}, this.id._serialized, subject);
|
||||
|
||||
if(res.status == 200) {
|
||||
@@ -100,7 +100,8 @@ class GroupChat extends Chat {
|
||||
*/
|
||||
async setDescription(description) {
|
||||
let res = await this.client.pupPage.evaluate((chatId, description) => {
|
||||
return Store.Chat.get(chatId).setGroupDesc(description);
|
||||
let descId = Store.GroupMetadata.get(chatId).descId;
|
||||
return Store.Wap.setGroupDescription(chatId, description, Store.genId(), descId);
|
||||
}, this.id._serialized, description);
|
||||
|
||||
if (res.status == 200) {
|
||||
|
||||
@@ -7,6 +7,7 @@ exports.ExposeStore = (moduleRaidStr) => {
|
||||
eval("var moduleRaid = " + moduleRaidStr);
|
||||
window.mR = moduleRaid();
|
||||
window.Store = window.mR.findModule("Conn")[0].default;
|
||||
window.Store.genId = window.mR.findModule((module) => module.default && typeof module.default === 'function' && module.default.toString().match(/crypto/))[0].default;
|
||||
window.Store.SendMessage = window.mR.findModule("sendTextMsgToChat")[0].sendTextMsgToChat;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user