forked from Eksicode/eksicode-telegrambot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtelegram_func.js
More file actions
29 lines (21 loc) · 785 Bytes
/
telegram_func.js
File metadata and controls
29 lines (21 loc) · 785 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
27
28
29
const path = require("path");
require("dotenv").config({
path: path.join(__dirname, ".env")
});
const token = process.env.BOT_TOKEN;
const fs = require("fs");
const Telegraf = require("telegraf");
const CommandParser = require("telegraf-command-parts");
const bot = new Telegraf(token);
const fn = require("./functions");
const kanalBulunamadi = fs
.readFileSync("kanalBulunamadi.txt")
.toString()
.split("\r\n");
bot.use(CommandParser());
bot.command("kaynak", ctx => fn.cmd.kaynakCommand(ctx));
bot.command("kanal", ctx => fn.cmd.kanalCommand(ctx, kanalBulunamadi));
bot.command("pin", ctx => fn.cmd.pinCommand(ctx));
bot.command("ban", ctx => fn.cmd.banCommand(ctx));
bot.on(["new_chat_members", "left_chat_member"], fn.joinedLeftUserHandler);
bot.launch();