We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Below is my code, I am able to login successfully but after that bot doesn't revert or send message
/* eslint-env node */
// Ignore prettier formatting // prettier-ignore const venom = require('venom-bot');
venom .create( 'zzz', // Session name (base64Qr, asciiQR) => { console.log('QR Code:', asciiQR); }, (statusSession, session) => { console.log('Status Session:', statusSession); console.log('Session name:', session); }, { headless: false, devtools: true, executablePath: 'C:/Program Files/Google/Chrome/Application/chrome.exe', logQR: true, disableSpins: true } ) .then((client) => start(client)) .catch((error) => console.error('Error starting Venom:', error));
function start(client) { // prettier-ignore console.log("Bot started and listening for messages...");
client.onMessage((message) => { console.log('Received message:', message.body); console.log('From:', message.from); console.log('Is group message:', message.isGroupMsg);
// Log additional message properties console.log('Message ID:', message.id); console.log('Timestamp:', message.t); if (message.body === 'Hi' && message.isGroupMsg === false) { console.log('Sending response to:', message.from); // prettier-ignore client .sendText(message.from, 'Hello! This is an automated response from Venom.') .then((result) => { console.log('Message sent successfully:', result); }) .catch((error) => { console.error('Error sending message:', error); }); } else { console.log('No match for "Hi".'); }
}); }
The text was updated successfully, but these errors were encountered:
Below is my code, I am able to login successfully but after that bot doesn't revert or send message /* eslint-env node */ // Ignore prettier formatting // prettier-ignore const venom = require('venom-bot'); venom .create( 'zzz', // Session name (base64Qr, asciiQR) => { console.log('QR Code:', asciiQR); }, (statusSession, session) => { console.log('Status Session:', statusSession); console.log('Session name:', session); }, { headless: false, devtools: true, executablePath: 'C:/Program Files/Google/Chrome/Application/chrome.exe', logQR: true, disableSpins: true } ) .then((client) => start(client)) .catch((error) => console.error('Error starting Venom:', error)); function start(client) { // prettier-ignore console.log("Bot started and listening for messages..."); client.onMessage((message) => { console.log('Received message:', message.body); console.log('From:', message.from); console.log('Is group message:', message.isGroupMsg); // Log additional message properties console.log('Message ID:', message.id); console.log('Timestamp:', message.t); if (message.body === 'Hi' && message.isGroupMsg === false) { console.log('Sending response to:', message.from); // prettier-ignore client .sendText(message.from, 'Hello! This is an automated response from Venom.') .then((result) => { console.log('Message sent successfully:', result); }) .catch((error) => { console.error('Error sending message:', error); }); } else { console.log('No match for "Hi".'); } }); }
Try this.
> const venom = require('venom-bot'); > venom > .create( > 'zzz', // Session name > (base64Qr, asciiQR) => { > console.log('QR Code:', asciiQR); > }, > (statusSession, session) => { > console.log('Status Session:', statusSession); > console.log('Session name:', session); > }, > { > headless: 'new', > devtools: true, > logQR: true, > disableSpins: true > } > ) > .then((client) => start(client)) > .catch((error) => console.error('Error starting Venom:', error)); > > > function start(client) { > console.log("Bot started and listening for messages..."); > > client.onMessage((message) => { > console.log('Received message:', message.body); > console.log('From:', message.from); > console.log('Is group message:', message.isGroupMsg); > console.log('Message ID:', message.id); > console.log('Timestamp:', message.t); > > if (message.body === 'Hi' && message.isGroupMsg === false) { > console.log('Sending response to:', message.from); > client > .sendText(message.from, 'Hello! This is an automated response from Venom.') > .then((result) => { > console.log('Message sent successfully:', result); > }) > .catch((error) => { > console.error('Error sending message:', error); > }); > } else { > console.log('No match for "Hi".'); > } > }); > }
Sorry, something went wrong.
No branches or pull requests
Below is my code, I am able to login successfully but after that bot doesn't revert or send message
/* eslint-env node */
// Ignore prettier formatting
// prettier-ignore
const venom = require('venom-bot');
venom
.create(
'zzz', // Session name
(base64Qr, asciiQR) => {
console.log('QR Code:', asciiQR);
},
(statusSession, session) => {
console.log('Status Session:', statusSession);
console.log('Session name:', session);
},
{
headless: false,
devtools: true,
executablePath: 'C:/Program Files/Google/Chrome/Application/chrome.exe',
logQR: true,
disableSpins: true
}
)
.then((client) => start(client))
.catch((error) => console.error('Error starting Venom:', error));
function start(client) {
// prettier-ignore
console.log("Bot started and listening for messages...");
client.onMessage((message) => {
console.log('Received message:', message.body);
console.log('From:', message.from);
console.log('Is group message:', message.isGroupMsg);
});
}
The text was updated successfully, but these errors were encountered: