-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
55 lines (42 loc) · 2.13 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
const Discord = require('discord.js');
const colors = require("colors");
const fs = require("fs");
const config = JSON.parse(fs.readFileSync("./cfg/config.json", "utf8"));
require("dotenv").config();
//var client = new Discord.Client();
const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds,Discord.GatewayIntentBits.GuildMessages,Discord.GatewayIntentBits.MessageContent], partials: [Discord.Partials.Channel] });
// ----------------------------------------------------------------------------------------------------------------------
client.commands = new Discord.Collection();
const CommandFiles = fs.readdirSync("./commands/").filter(files => files.endsWith(".js"));
for (const file of CommandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.on("messageCreate", message => {
if(!message.content.startsWith(config.prefix) || message.author.bot) return;
//console.log("fasdgöjkklsdfdsfsfn")
const args = message.content.slice(config.prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === "help"){
client.commands.get("help").execute(message, args);
}else if(command === "meme"){
client.commands.get("meme").execute(message, args);
}else if(command === "ping"){
client.commands.get("ping").execute(message, args);
}else if(command === "clear"){
client.commands.get("clear").execute(message, args);
}
});
// client.on("messageReactionAdd", (messageReaction, user) => {
// if (messageReaction.emoji.id === "740914495521554522") {
// if (user.bot) return;
// TicketChannelAdd.Add(messageReaction.message, user);
// }
// });
// ----------------------------------------------------------------------------------------------------------------------
client.login(process.env.token);
client.on("ready", () =>{
var TicketChannelIDs = [];
console.log(colors.rainbow(`Logged in as ${client.user.tag} Version: ${config.version}!`));
client.user.setActivity(`Version: ${config.version}`, {type: Discord.ActivityType.Watching});
});