-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
108 lines (72 loc) · 4.24 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/***************************************************************************/
/* */
/* Made by Mr Swift */
/* Best Source FOR Discord Bot */
/* Server Support :https://discord.gg/6Zgu6TN */
/* My instagram : Mr_.swift */
/* Copyright: 2020 */
/* */
/***************************************************************************/
console.log(`\n\nW8 For 20s\n\n`)
const Discord = require('discord.js-self');
const client = new Discord.Client();
const config = require("./config.json")
const token = `${config.botstat.tokenbot}`;
const{ readdirSync } = require('fs');
const { join } = require('path');
client.commands = new Discord.Collection();
const perfix = `${config.botstat.prefix}`;
const commandsFiles = readdirSync(join(__dirname,"commands")).filter(file => file.endsWith(".js"))
/* Made by Mr Swift */
for (const file of commandsFiles){
const command = require(join(__dirname,"commands",`${file}`));
client.commands.set(command.name, command);
}
/* Made by Mr Swift */
client.on('ready',()=> {
console.log("\n\nSylvanas is Ready\n\n");
client.user.setActivity("GG",{ type: 'WATCHING' })
});
/***************************************************************************/
/* */
/* Made by Mr Swift */
/* Best Source FOR Discord Bot */
/* Server Support :https://discord.gg/6Zgu6TN */
/* My instagram : Mr_.swift */
/* Copyright: 2020 */
/* */
/***************************************************************************/
client.on("message",async message => {
/***************************************************************************/
/* */
/* Made by Mr Swift */
/* Best Source FOR Discord Bot */
/* Server Support :https://discord.gg/6Zgu6TN */
/* My instagram : Mr_.swift */
/* Copyright: 2020 */
/* */
/***************************************************************************/
if (message.author.bot) return;
if (message.channel.type === 'dm') return;
if (message.content.startsWith(perfix)){
const args = message.content.slice(perfix.length).trim().split(/ +/);
const command = args.shift().toLowerCase();
/* Made by Mr Swift */
if(!client.commands.has(command)) return;
try{
client.commands.get(command).run(client,message,args);
}catch(error){
console.log(error);
}
}
})
client.login(token);
/***************************************************************************/
/* */
/* Made by Mr Swift */
/* Best Source FOR Discord Bot */
/* Server Support :https://discord.gg/6Zgu6TN */
/* My instagram : Mr_.swift */
/* Copyright: 2020 */
/* */
/***************************************************************************/