randydev commited on
Commit
73c3a84
·
verified ·
1 Parent(s): 0dd7c34

Update bot/telegrambot.js

Browse files
Files changed (1) hide show
  1. bot/telegrambot.js +9 -5
bot/telegrambot.js CHANGED
@@ -4,11 +4,15 @@ import { BotToken } from "../config.js";
4
  const bot = new Bot(BotToken);
5
 
6
  function InitBot() {
7
- bot.command("start", (ctx) => {
8
- ctx.reply("Welcome to the bot! 🚀");
9
- });
10
- bot.start();
11
- console.log("Bot is running...");
 
 
 
 
12
  }
13
 
14
  export { InitBot };
 
4
  const bot = new Bot(BotToken);
5
 
6
  function InitBot() {
7
+ try {
8
+ bot.command("start", (ctx) => {
9
+ ctx.reply("Welcome to the bot! 🚀");
10
+ });
11
+ bot.start();
12
+ console.log("Bot is running...");
13
+ } catch (e) {
14
+ console.error("Error", e.message);
15
+ }
16
  }
17
 
18
  export { InitBot };