-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
69 lines (53 loc) · 2.14 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
const { Client, Collection, Intents } = require('discord.js');
const fs = require('fs');
const db = require("quick.db");
const client = new Client({
intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES ]
});
client.events = new Collection();
client.commands = new Collection();
client.config = require('./conf.json');
client.on('ready', () => console.log('bot bağlandı'));
client.on('ready', () => console.log(`Logged in as ${client.user.tag}`));
fs.readdir('./commands/', async (err, files) => {
if (err) throw new Error(err);
files.forEach(async (dosya) => {
var cmd = require(`./commands/${dosya}`);
client.commands.set(cmd.name, cmd);
});
});
fs.readdir('./events/', async (err, files) => {
if (err) throw new Error(err);
files.forEach(async (dosya) => {
var event = require(`./events/${dosya}`);
client.events.set(event.name, event);
});
});
const prefix = client.config.prefix;
client.on('messageCreate', async (message) => {
client.events.get('messageCreate').execute(client, message, prefix)
});
client.on('messageCreate', async (message) => {
const db = require("quick.db")
db.add(`coin_${message.author.id}`, 1);
});
client.on('messageCreate', async (message) => {
const db = require("quick.db")
db.add(`mesajsayi_${message.guild.id}_${message.author.id}`, 1);
});
client.on('ready', async (ready) => {
client.user.setActivity("Ghost Coin Ekonomi")
});
client.on("messageCreate", message => {
const db = require("quick.db");
let mesajsayi = db.fetch(`mesajsayi_${message.guild.id}_${message.author.id}`);
if(mesajsayi == "500") {
db.add(`coin_${message.author.id}`, 50)
message.channel.send(`:sparkles: **| ${message.author.username}**, Toplamda 500 mesaja ulaştın ve 50 coin topladın! <a:wumpus:935967291777118208>`);
};
if(mesajsayi == "1000") {
db.add(`usermoney.${message.author.id}`, 100)
message.channel.send(`:sparkles: **| ${message.author.username}**, Toplamda 1000 mesaja ulaştın ve 100 coin topladın! <a:wumpus:935967291777118208>`);
};
});
client.login(client.config.token);