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

25
index.d.ts vendored
View file

@ -75,6 +75,9 @@ declare namespace WAWebJS {
/** Get all current Labels */
getLabels(): Promise<Label[]>
/** Get all current Broadcasts */
getBroadcasts(): Promise<Broadcast[]>
/** Change labels in chats */
addOrRemoveLabels(labelIds: Array<number|string>, chatIds: Array<string>): Promise<void>
@ -1089,6 +1092,28 @@ declare namespace WAWebJS {
getChats: () => Promise<Chat[]>
}
export interface Broadcast {
/** Chat Object ID */
id: {
server: string,
user: string,
_serialized: string
},
/** Unix timestamp of last story */
timestamp: number,
/** Number of available statuses */
totalCount: number,
/** Number of not viewed */
unreadCount: number,
/** Unix timestamp of last story */
msgs: Message[],
/** Returns the Chat of the owner of the story */
getChat: () => Promise<Chat>,
/** Returns the Contact of the owner of the story */
getContact: () => Promise<Contact>,
}
/** Options for sending a message */
export interface MessageSendOptions {
/** Show links preview. Has no effect on multi-device accounts. */