forked from GONE-Collection/CloudUPBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCloudUP.js
More file actions
42 lines (29 loc) · 1.45 KB
/
CloudUP.js
File metadata and controls
42 lines (29 loc) · 1.45 KB
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
const Discord = require("discord.js");
const { Client, RichEmbed } = require("discord.js");
const CloudUP = new Discord.Client({ disableEveryone: true, disabledEvents: ["TYPING_START"] });// Discorda bağlanırken sorun yaşamaması için :).
const { CommandHandler } = require("djs-commands");// Komut Modülü
require('dotenv').config();// .env içindir. Token & Database için çok önemli modüldür. Gizli kılar.
const CH = new CommandHandler({
folder: __dirname + "/CloudUP-Commands/",
timeout: 1.4,
prefix: ["c!", "C!", "."]
})//komutu çalıştırmak ve komutları çekmek için olan kısımdır.
CloudUP.on("message", async (message) => {
if(message.channel.type === 'dm') return;
if(message.author.type === 'bot') return;
let args = message.content.split(" ");
let command = args[0];
let cmd = CH.getCommand(command);
if(!cmd) return;
try{
cmd.run(CloudUP,message,args)
}catch(e){
console.log(e)
}
console.log(`${message.author.tag} adlı kullanıcı ${command} adlı kodu kullandı! Komutu kullandığı kanal: ${message.channel.name} || Sunucu: ${message.guild.name}`)
//Komutu kim kullanmış kim nerede ne yapıyor kısmı.
});
CloudUP.on('ready', () => {
console.log(`${CloudUP.user.tag} Aktif halde.`)
CloudUP.user.setStatus('online').catch(console.error)})//Profile ne koyacağını sen yap!
CloudUP.login(process.env.CLIENT_TOKEN).catch(console.error);//Stabil çalışmasını sağlar.