mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 04:29:15 +00:00
Release all limiters
This commit is contained in:
@@ -71,14 +71,14 @@ class Buttons {
|
|||||||
*/
|
*/
|
||||||
_format(buttons){
|
_format(buttons){
|
||||||
// Limit the buttons (max 3 of regular and 3 of special buttons) 5 buttons total at the same time
|
// Limit the buttons (max 3 of regular and 3 of special buttons) 5 buttons total at the same time
|
||||||
const templateButtons = buttons.filter(button => button.url || button.number).slice(0,3);
|
const templateButtons = buttons.filter(button => button.url || button.number);
|
||||||
const regularButtons = buttons.filter(button => !button.url && !button.number).slice(0,3);
|
const regularButtons = buttons.filter(button => !button.url && !button.number);
|
||||||
buttons = templateButtons.concat(regularButtons).slice(0,5);
|
buttons = templateButtons.concat(regularButtons);
|
||||||
|
|
||||||
return buttons.map((button, index) => {
|
return buttons.map((button, index) => {
|
||||||
if (button.url && button.number && button.id) throw 'Only pick one of the following (url/number/id)';
|
if (button.url && button.number && button.id) throw 'Only pick one of the following (url/number/id)';
|
||||||
if (button.number) {
|
if (button.number) {
|
||||||
throw 'Not supported, URL and Call buttons are not supported on IOS';
|
console.log("[WARNING] THIS FEATURE (CALL BUTTONS) IS UNSTABLE AND IS NOT TESTED OR EXPECTED TO WORK ON ALL PLATFORMS. Help test this feature with us on https://github.com/wwebjs/buttons-test")
|
||||||
return {
|
return {
|
||||||
index,
|
index,
|
||||||
callButton: {
|
callButton: {
|
||||||
@@ -87,7 +87,7 @@ class Buttons {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else if (button.url) {
|
} else if (button.url) {
|
||||||
throw 'Not supported, URL and Call buttons are not supported on IOS';
|
console.log("[WARNING] THIS FEATURE (URL BUTTONS) IS UNSTABLE AND IS NOT TESTED OR EXPECTED TO WORK ON ALL PLATFORMS. Help test this feature with us on https://github.com/wwebjs/buttons-test")
|
||||||
return {
|
return {
|
||||||
index,
|
index,
|
||||||
urlButton: {
|
urlButton: {
|
||||||
|
|||||||
Reference in New Issue
Block a user