ryu-js / bot /telegrambot.js
randydev's picture
Update bot/telegrambot.js
89182c5 verified
raw
history blame
374 Bytes
import { Bot } from 'grammy';
import { BotToken } from "../config.js";
const bot = new Bot(BotToken);
bot.command("start", async (ctx) => {
await ctx.reply("Welcome to the bot! 🚀");
});
const InitBot = async () => {
try {
await bot.start();
console.log("Bot is running...");
} catch (e) {
console.error("Error", e.message);
}
}
export { InitBot };