Why am I getting this error When I use async
?
My Code:
bot.onText(//start/, async msg => {
const opts = {
parse_mode: 'Markdown' ,
reply_markup: JSON.stringify({
keyboard: StartKeyboard,
resize_keyboard: true,
one_time_keyboard: true
})
};
await bot.sendMessage(msg.chat.id, 'Hi', opts);
});
Error:
bot.onText(//start/, async msg => {
^^^^^
SyntaxError: missing ) after argument list
I'm using node.js v6.11.0 with "dependencies":
{ "babel-polyfill": "^6.23.0",
"cheerio": "^1.0.0-rc.2",
"dotenv": "^4.0.0",
"firebase": "^4.1.2",
"firebase-admin": "^5.0.0",
"node-telegram-bot-api": "^0.27.1",
"request": "^2.81.0" },
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…