Skip to content

Commit af5cd5b

Browse files
author
AffanTheBest
committed
Add error handling
1 parent 383512d commit af5cd5b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

bot.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ const reply_markup = { //common repky markup
2020
}
2121

2222
bot.command('start', (ctx) => { // start command
23-
ctx.reply(`Hello ${ctx.message.chat.first_name}, I can track price for Amazon & Flipkart products (Soon more).\n\nCheck /help to get started.\n`,
24-
{
25-
reply_to_message_id: ctx.message.message_id,
26-
reply_markup
27-
});
28-
manageUsers({ id: ctx.message.from.id, name: ctx.message.from.first_name }, 'update');
23+
try{
24+
ctx.reply(`Hello ${ctx.message.chat.first_name}, I can track price for Amazon & Flipkart products (Soon more).\n\nCheck /help to get started.\n`,
25+
{
26+
reply_to_message_id: ctx.message.message_id,
27+
reply_markup
28+
});
29+
manageUsers({ id: ctx.message.from.id, name: ctx.message.from.first_name }, 'update');
30+
}catch (e) { }
2931
});
3032

3133
bot.command('help', (ctx) => { // help command

0 commit comments

Comments
 (0)