-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.js
74 lines (71 loc) · 3.31 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
________________________________________________
/ \
| _________________________________________ |
| | | |
| | KMCODES BlackList System By KINGMAN | |
| | | |
| | Devloper ["Muhammad Kurkar"] | |
| | | |
| | Phone Number ["+962792914245"] | |
| | | |
| | All rights reserved to KIGNAMN | |
| | | |
| | If there is any error, just visit the | |
| | | |
| | KINGMANDEV Discord Server | |
| | | |
| |_________________________________________| |
| |
\_________________________________________________/
\___________________________________/
___________________________________________
_-' .-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. --- `-_
_-'.-.-. .---.-.-.-.-.-.-.-.-.-.-.-.-.-.-.--. .-.-.`-_
_-'.-.-.-. .---.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-`__`. .-.-.-.`-_
_-'.-.-.-.-. .-----.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-----. .-.-.-.-.`-_
_-'.-.-.-.-.-. .---.-. .-------------------------. .-.---. .---.-.-.-.`-_
:-------------------------------------------------------------------------:
`---._.-------------------------------------------------------------._.---'
*/
const Discord = require("discord.js");
const discord = require("discord.js");
const kingman = require("./alive/keep_work.js")
const { MessageEmbed , Collection , Client } = require("discord.js");
const client = new Client()
client.commands = new discord.Collection();
client.eventss = new discord.Collection();
client.aliases = new discord.Collection();
const fs = require('fs');
kingman();
const colors = require("colors");
const TOKEN_BOT = process.env['ME_TOKEN']
const config = require('./me-config.json');
const PREFIX = config.prefix
client.on("error", console.error);
["command", "events"].forEach(p => {
require(`./me-handler/${p}`)(client);
});
client.on('message', kmsg => {
const pmention = new RegExp(`^<@!?${client.user.id}>( |)$`);
if (kmsg.content.match(pmention)) {
return kmsg.reply(`**MY PREFIX IS: ${PREFIX}**`)
}
if (kmsg.author.bot) return;
if (!kmsg.guild) {
return kmsg.reply("**ONLY WORK ON SERVERS NOT DM**")
}
let prefix = PREFIX;
const args1 = kmsg.content.slice(prefix.length).split(/ +/);
if (!kmsg.content.startsWith(PREFIX)) return;
const args = kmsg.content
.slice(PREFIX.length)
.trim()
.split(/ +/g);
const kmcommand = args.shift().toLowerCase();
if (kmcommand.length === 0) return;
let kmcode = client.commands.get(kmcommand);
if (!kmcode) kmcode = client.commands.get(client.aliases.get(kmcommand));
if (kmcode) kmcode.run(client, kmsg, args, PREFIX , prefix);
});
client.login(TOKEN_BOT)