-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (22 loc) · 755 Bytes
/
index.js
File metadata and controls
26 lines (22 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const { Telegraf } = require('telegraf');
const fs = require('fs');
const path = require('path');
const bot = new Telegraf('BURAYA BOT TOKENİNİ YAZ');
// Komut Dosyası
const komutlarKlasoru = path.join(__dirname, 'komutlar');
const komutlar = [];
fs.readdirSync(komutlarKlasoru).forEach(file => {
const komut = require(`./komutlar/${file}`);
komutlar.push({ name: komut.name, description: komut.description });
bot.command(komut.name, komut.execute);
});
// /yardim komutu (OTO Ekliyor)
bot.command('yardim', (ctx) => {
let mesaj = "Yardım Menüsü:\n";
komutlar.forEach(komut => {
mesaj += `/${komut.name} - ${komut.description}\n`;
});
ctx.reply(mesaj);
});
bot.launch();
console.log("Bot çalışıyor...");