Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}),
});
bot.onEvent(async context => {
if (context.event.isCommentAdd && !context.event.isSentByPage) {
try {
await context.sendPrivateReply('OK!');
await context.sendComment('Public reply!');
await context.sendLike();
} catch (err) {
console.log(err);
}
}
});
const server = createServer(bot, { verifyToken: VERIFY_TOKEN });
module.exports = server;
bot.onEvent(async context => {
console.log(context.event);
if (context.event.isCommentAdd && !context.event.isSentByPage) {
try {
await context.sendPrivateReply('OK!');
await context.sendComment('Public Reply!');
await context.sendLike();
} catch (err) {
console.log(err.response.data);
}
}
});
const server = createServer(bot, { verifyToken: VERIFY_TOKEN });
module.exports = server;
bot.onEvent(async context => {
console.log(context.event);
if (context.event.isCommentAdd && !context.event.isSentByPage) {
try {
await context.sendPrivateReply('OK!');
await context.sendComment('Public Reply!');
await context.sendLike();
} catch (err) {
console.log(err.response.data);
}
}
});
const server = createServer(bot, { verifyToken: VERIFY_TOKEN });
module.exports = server;
const { MessengerBot } = require('bottender');
const { createServer } = require('bottender/koa');
const bot = new MessengerBot({
accessToken: '__FILL_YOUR_TOKEN_HERE__',
appSecret: '__FILL_YOUR_SECRET_HERE__',
});
bot.onEvent(async context => {
await context.sendText('Hello World');
});
const server = createServer(bot);
server.listen(5000, () => {
console.log('server is running on 5000 port...');
});