This repository was archived by the owner on Mar 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTesting.js
More file actions
52 lines (39 loc) · 1.67 KB
/
Testing.js
File metadata and controls
52 lines (39 loc) · 1.67 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
43
44
45
46
47
48
49
50
51
52
const Discord = require('discord.js');
const bot = new Discord.Client();
const db = require('quick.db');
const prefix = "--"
bot.on('message', async message => {
db.add("userBalance_" + message.author.id, 1)
var guild = message.guild;
var author = message.author;
var user = message.mentions.users.first() || message.author
let bal = await db.fetch("userBalance_" + user.id);
if(bal === null) bal = 0;
if (message.content.toLowerCase().startsWith(prefix + 'bal')) {
var embed = new Discord.RichEmbed();
if (message.author.bot) return;
embed.setColor('BLUE');
embed.setDescription(bal);
message.channel.send({embed});
}
var user = message.mentions.users.first();
var args = message.content.split(' '); var g = " "; for(var i = 1; i < args.length; i++){ g = g+" "+args[i]; }
if (message.content.toLowerCase().startsWith(prefix + 'givemoney')) {
db.add("userBalance_" + user.id, 100)
var embed = new Discord.RichEmbed();
if (message.author.bot) return;
embed.setColor('BLUE');
embed.setDescription(bal);
message.channel.send({embed});
}
if (message.content.toLowerCase() === prefix + "ping") {
const m = await message.channel.send("Ping?");
var ping = Math.round(m.createdTimestamp - message.createdTimestamp)
var embed = new Discord.RichEmbed();
embed.setColor('BLUE');
embed.setDescription("Latency ping " + ping + "ms\nApi ping " + Math.round(bot.ping) + 'ms')
m.edit({embed});
}
db.set("userBalance_" + message.author.id, bal)
});
bot.login(process.env.BOT_TOKEN)