Get Stories (#3294)

* Get all broadcast

* fixed return msgs

* feat: add usage example

* Update src/structures/Broadcast.js

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>

---------

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
This commit is contained in:
tofers 2024-09-30 20:33:31 +03:00 • committed by GitHub
commit 5b0e139ad4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 125 additions and 2 deletions

View file

@ -1013,5 +1013,16 @@ exports.LoadUtils = () => {
const response = await window.Store.pinUnpinMsg(message, action, duration);
return response.messageSendResult === 'OK';
};
window.WWebJS.getStatusModel = status => {
let res = status.serialize();
delete res._msgs;
res.msgs = status._msgs.map(msg => window.WWebJS.getMessageModel(msg));
return res;
};
window.WWebJS.getAllStatuses = () => {
const statuses = window.Store.Status.getModelsArray();
return statuses.map(status => window.WWebJS.getStatusModel(status));
};
};