You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.
Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"
check the previous postUpdate baileys and use template message for button message.
format Button message:
JSON:{"text":"Type here bro","footer":"Powered by me","templateButtons":[{"index":"1","quickReplyButton":{"displayText":"Yes"}},{"index":"2","quickReplyButton":{"displayText":"No"}}]}
format Template message:
JSON:{"text":"Type here bro","footer":"Powered by me","templateButtons":[{"index":"1","quickReplyButton":{"displayText":"Yes"}},{"index":"2","urlButton":{"displayText":"https://google.com"}},{"index":"3","callButton":{"displayText":"+6282160812020"}}]}
Can you make me an sample in html?there are 2 ways to make it, if you use
you just load it into an image.srcJavaScript:const qrimg = require('qr-image');
if you use this, you have to convert it to base64 then load it into image.src
JavaScript:const QRcode = require('qrcode');
<div class="card-body">
<div class="imageee text-center px-5"></div>
<div class="text-center" id="but">
<button type="button" id="gen-code" class="btn btn-secondary btn-sm waves-effect waves-float waves-light mt-5 mb-5">Generate QR Code</button>
</div>
<div class="statusss text-center" id="qr">
@if(Auth::user()->is_expired_subscription)
<div class="alert alert-danger" role="alert">
<div class="alert-body">
<div class="alert-body">Your Subscription is <strong>Expired</strong>, please renew your Subscription.</div>
</div>
</div>
<button type="button" class="btn btn-secondary btn-sm waves-effect waves-float waves-light"><i data-feather='battery-charging'></i> Upgrade Now</button>
@else
<div class="d-flex justify-content-center my-1">
<div class="spinner-grow text-primary mr-1 font-medium-3" role="status">
<span class="sr-only">Loading...</span>
</div>
Connecting to server...
</div>
@endif
</div>
</div>
$("#qr").hide();
$("#gen-code").click(function() {
generateQR();
});
function generateQR() {
$("#qr").show();
$("#but").hide();
var is_expired_subscription = '{{Auth::user()->is_expired_subscription}}';
if(!is_expired_subscription){
let socket;
let device = '{{$number}}';
if('{{env('TYPE_SERVER')}}' === 'hosting') {
socket = io();
} else {
socket = io('{{env('WA_URL_SERVER')}}', {
transports: ['websocket', 'polling', 'flashsocket']
});
}
socket.emit('StartConnection','{{$number}}')
socket.on('qrcode', ({token,data,message}) => {
if(token == device ) {
let url = data
$('.imageee').html(`<img src="${url}" class="card-img-top" alt="Scan QR">`)
let count = 0;
$('.statusss').html(`<div class="alert alert-warning" role="alert">
<div class="alert-body">${message}</div>
</div>`)
}
})
socket.on('connection-open',({token,user,ppUrl}) => {
if(token === device ) {
var parts = user.id.split(":");
var phoneNumber = parts[0];
var username = user.name;
$('.name').html(`Name : ${user.name}`)
$('.number').html(`Number : ${user.id}`)
$('.device').html(`Device / Token : Not detected - ${token}`)
$('.imageee').html(`<img src="${ppUrl}" class="card-img-top" alt="${user.name}">`)
$('.statusss').html(`<span class="badge badge-glow badge-success d-block ml-3 mr-3 mt-1">Connected</span>`)
Swal.fire({
icon: 'success',
title: 'Your Device Connected',
customClass: {
confirmButton: 'btn btn-primary'
},
customClass: {
confirmButton: 'btn btn-primary'
},
buttonsStyling: false
}).then(function (result) {
if (result.value) {
location.reload();
}
});
}
})
socket.on('Unauthorized',({token})=> {
if(token == device ) {
$('.statusss').html(` <div class="alert alert-danger" role="alert">
<div class="alert-body">Unauthorized</div>
</div>`)
}
})
socket.on('message',({token,message})=> {
if(token == device ) {
if (message === 'successfully scanned '+token) {
console.log('Connected');
}
if (message === 'Connection closed. You are logged out.') {
setTimeout(() => {
generateQR();
}, 3000);
}
$('.statusss').html(` <div class="alert alert-success" role="alert">
<div class="alert-body">${message}</div>
</div>`)
setTimeout(() => {
$(".showqr").load(" .showqr");
}, 3000);
}
})
}
}
Can I apply QR API only in one html or php file?like the html script that I use...
hahaha please check, if you need something I will explain..
HTML:<div class="card-body"> <div class="imageee text-center px-5"></div> <div class="text-center" id="but"> <button type="button" id="gen-code" class="btn btn-secondary btn-sm waves-effect waves-float waves-light mt-5 mb-5">Generate QR Code</button> </div> <div class="statusss text-center" id="qr"> @if(Auth::user()->is_expired_subscription) <div class="alert alert-danger" role="alert"> <div class="alert-body"> <div class="alert-body">Your Subscription is <strong>Expired</strong>, please renew your Subscription.</div> </div> </div> <button type="button" class="btn btn-secondary btn-sm waves-effect waves-float waves-light"><i data-feather='battery-charging'></i> Upgrade Now</button> @else <div class="d-flex justify-content-center my-1"> <div class="spinner-grow text-primary mr-1 font-medium-3" role="status"> <span class="sr-only">Loading...</span> </div> Connecting to server... </div> @endif </div> </div>
this is javascript for load QR & status device..
JavaScript:$("#qr").hide(); $("#gen-code").click(function() { generateQR(); }); function generateQR() { $("#qr").show(); $("#but").hide(); var is_expired_subscription = '{{Auth::user()->is_expired_subscription}}'; if(!is_expired_subscription){ let socket; let device = '{{$number}}'; if('{{env('TYPE_SERVER')}}' === 'hosting') { socket = io(); } else { socket = io('{{env('WA_URL_SERVER')}}', { transports: ['websocket', 'polling', 'flashsocket'] }); } socket.emit('StartConnection','{{$number}}') socket.on('qrcode', ({token,data,message}) => { if(token == device ) { let url = data $('.imageee').html(`<img src="${url}" class="card-img-top" alt="Scan QR">`) let count = 0; $('.statusss').html(`<div class="alert alert-warning" role="alert"> <div class="alert-body">${message}</div> </div>`) } }) socket.on('connection-open',({token,user,ppUrl}) => { if(token === device ) { var parts = user.id.split(":"); var phoneNumber = parts[0]; var username = user.name; $('.name').html(`Name : ${user.name}`) $('.number').html(`Number : ${user.id}`) $('.device').html(`Device / Token : Not detected - ${token}`) $('.imageee').html(`<img src="${ppUrl}" class="card-img-top" alt="${user.name}">`) $('.statusss').html(`<span class="badge badge-glow badge-success d-block ml-3 mr-3 mt-1">Connected</span>`) Swal.fire({ icon: 'success', title: 'Your Device Connected', customClass: { confirmButton: 'btn btn-primary' }, customClass: { confirmButton: 'btn btn-primary' }, buttonsStyling: false }).then(function (result) { if (result.value) { location.reload(); } }); } }) socket.on('Unauthorized',({token})=> { if(token == device ) { $('.statusss').html(` <div class="alert alert-danger" role="alert"> <div class="alert-body">Unauthorized</div> </div>`) } }) socket.on('message',({token,message})=> { if(token == device ) { if (message === 'successfully scanned '+token) { console.log('Connected'); } if (message === 'Connection closed. You are logged out.') { setTimeout(() => { generateQR(); }, 3000); } $('.statusss').html(` <div class="alert alert-success" role="alert"> <div class="alert-body">${message}</div> </div>`) setTimeout(() => { $(".showqr").load(" .showqr"); }, 3000); } }) } }
This is what it looks like approximately..
yes no problem...Can I apply QR API only in one html or php file?
My whatsapp Gateway in other server ,not same server
Where the QR API file is located in the html file that is given before ityes no problem...
Only use 1 php file..
Script that I use does not use API, it is a script directly using the web socket..Where the QR API file is located in the html file that is given before it
Thanx a lot bro
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/socket.io/
RewriteCond %{REQUEST_URI} !^/backend-*
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
</IfModule>
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
You have this problem because the condition isYes, I have selected the device but it still doesn't work, an error always appears on the right side of the screen, this even happened in the official demo
thanks man
We get it, advertisements are annoying!
However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.
If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.