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:
parent
289b354285
commit
5b0e139ad4
7 changed files with 125 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ const { LoadUtils } = require('./util/Injected/Utils');
|
|||
const ChatFactory = require('./factories/ChatFactory');
|
||||
const ContactFactory = require('./factories/ContactFactory');
|
||||
const WebCacheFactory = require('./webCache/WebCacheFactory');
|
||||
const { ClientInfo, Message, MessageMedia, Contact, Location, Poll, PollVote, GroupNotification, Label, Call, Buttons, List, Reaction } = require('./structures');
|
||||
const { ClientInfo, Message, MessageMedia, Contact, Location, Poll, PollVote, GroupNotification, Label, Call, Buttons, List, Reaction, Broadcast} = require('./structures');
|
||||
const NoAuth = require('./authStrategies/NoAuth');
|
||||
const {exposeFunctionIfAbsent} = require('./util/Puppeteer');
|
||||
|
||||
|
|
@ -1472,6 +1472,17 @@ class Client extends EventEmitter {
|
|||
|
||||
return labels.map(data => new Label(this, data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all current Broadcast
|
||||
* @returns {Promise<Array<Broadcast>>}
|
||||
*/
|
||||
async getBroadcasts() {
|
||||
const broadcasts = await this.pupPage.evaluate(async () => {
|
||||
return window.WWebJS.getAllStatuses();
|
||||
});
|
||||
return broadcasts.map(data => new Broadcast(this, data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Label instance by ID
|
||||
|
|
|
|||
Loading…
Reference in a new issue