-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
37 lines (30 loc) · 1.07 KB
/
index.js
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
30
31
32
33
34
35
36
37
/*
* Nama Pengembang: Sazumi Viki
* Kontak Whatsapp: wa.me/6285236226786
* Kontak Telegram: t.me/sazumiviki
* Akun Github: github.com/SazumiVicky
* Catatan: Skrip ini tidak dijual.
*/
require('dotenv').config();
const TelegramBot = require('node-telegram-bot-api');
const ownerCommand = require('./src/command/owner');
const sourceCommand = require('./src/command/source');
const openaiCommand = require('./src/command/openai');
const specCommand = require('./src/command/spec');
const { printMessage } = require('./lib/print');
const config = require('./config');
const token = process.env.TOKEN;
const bot = new TelegramBot(token, { polling: true });
ownerCommand(bot);
sourceCommand(bot);
openaiCommand(bot);
specCommand(bot);
bot.onText(/\/start/, (msg) => {
const chatId = msg.chat.id;
const username = msg.from.username;
const welcomeMessage = `👋 Halo *${username}*, selamat datang di bot MakeMeow! Senang bisa bertemu dengan kamu.`;
bot.sendMessage(chatId, welcomeMessage, { parse_mode: 'Markdown' });
});
bot.on('message', (msg) => {
printMessage(msg);
});