Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send buttons and Lists #756

Merged
merged 25 commits into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into patch-6
  • Loading branch information
tuyuribr authored Jul 27, 2021
commit 79121f962dc37439b1c2594efdebd5d29be522af
37 changes: 37 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,43 @@ declare namespace WAWebJS {

constructor(body: string, buttons: Array<Array<string>>, title?: string | null, footer?: string | null)
}

/**
* Represents a Call on WhatsApp
*
* @example
* Call {
* id: 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
* from: '5511999999@c.us',
* timestamp: 1625003709,
* isVideo: false,
* isGroup: false,
* fromMe: false,
* canHandleLocally: false,
* webClientShouldHandle: false,
* participants: []
* }
*/
export interface Call {
/** Call Id */
id: string,
/** from */
from?: string,
/** Unix timestamp for when the call was created*/
timestamp: number,
/** Is video */
isVideo: boolean,
/** Is Group */
isGroup: boolean,
/** Indicates if the call was sent by the current user */
fromMe: boolean,
/** indicates if the call can be handled in waweb */
canHandleLocally: boolean,
/** indicates if the call should be handled in waweb */
webClientShouldHandle: boolean,
/** Object with participants */
participants: object
}
}

export = WAWebJS
3 changes: 2 additions & 1 deletion src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const { WhatsWebURL, DefaultOptions, Events, WAState } = require('./util/Constan
const { ExposeStore, LoadUtils } = require('./util/Injected');
const ChatFactory = require('./factories/ChatFactory');
const ContactFactory = require('./factories/ContactFactory');
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification , Label, Buttons, List} = require('./structures');
const { ClientInfo, Message, MessageMedia, Contact, Location, GroupNotification , Label, Call, Buttons, List} = require('./structures');

/**
* Starting point for interacting with the WhatsApp Web API
* @extends {EventEmitter}
Expand Down
1 change: 1 addition & 0 deletions src/structures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = {
Label: require('./Label.js'),
Order: require('./Order'),
Product: require('./Product'),
Call: require('./Call'),
Buttons: require('./Buttons'),
List: require('./List')
};
4 changes: 2 additions & 2 deletions src/util/Injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ exports.LoadUtils = () => {
if (msg.dynamicReplyButtons) {
msg.dynamicReplyButtons = JSON.parse(JSON.stringify(msg.dynamicReplyButtons)); //not final version
}
if (msg.replyButtons) {
msg.replyButtons = JSON.parse(JSON.stringify(msg.replyButtons));
if(msg.replyButtons) {
msg.replyButtons = msg.replyButtons.serialize();
}

delete msg.pendingAckUpdate;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.