Remove bot files
This commit is contained in:
parent
647b77a587
commit
45a6cedfc1
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,4 +0,0 @@
|
||||
node_modules/
|
||||
.env
|
||||
.vibe42-run.log
|
||||
.vibe42-run.pid
|
||||
13
bot.js
13
bot.js
@ -1,13 +0,0 @@
|
||||
const { Bot } = require('grammy');
|
||||
|
||||
// Токен берётся из переменной окружения BOT_TOKEN (файл .env)
|
||||
const bot = new Bot(process.env.BOT_TOKEN);
|
||||
|
||||
bot.command('start', (ctx) => ctx.reply('Привет! Я бот. Напиши мне что-нибудь.'));
|
||||
|
||||
bot.on('message:text', (ctx) => {
|
||||
ctx.reply('Ты написал: ' + ctx.message.text);
|
||||
});
|
||||
|
||||
bot.start();
|
||||
console.log('Бот запущен (long‑polling)');
|
||||
@ -1,8 +0,0 @@
|
||||
{
|
||||
"name": "bot",
|
||||
"private": true,
|
||||
"type": "commonjs",
|
||||
"scripts": {
|
||||
"start": "node --env-file=.env bot.js"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user