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
25
index.d.ts
vendored
25
index.d.ts
vendored
|
|
@ -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. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue