-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathmain.js
33 lines (28 loc) · 980 Bytes
/
main.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
// Modul dan dependensi yang diperlukan
const events = require("./events/handler.js");
const {
Client,
CommandHandler
} = require("@mengkodingan/ckptw");
const path = require("path");
// Pesan koneksi
console.log(`[${config.pkg.name}] Connecting...`);
// Buat instance bot baru
const bot = new Client({
WAVersion: [2, 3000, 1015901307],
autoMention: config.system.autoMention,
markOnlineOnConnect: config.system.alwaysOnline,
phoneNumber: config.bot.phoneNumber,
prefix: config.bot.prefix,
readIncommingMsg: config.system.autoRead,
printQRInTerminal: !config.system.usePairingCode,
selfReply: config.system.selfReply,
usePairingCode: config.system.usePairingCode
});
// Penanganan events
events(bot);
// Buat penangan perintah dan muat perintah
const cmd = new CommandHandler(bot, path.resolve(__dirname, "commands"));
cmd.load();
// Luncurkan bot
bot.launch().catch((error) => console.error(`[${config.pkg.name}] Error:`, error));