-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcredentials.js
42 lines (36 loc) · 2.03 KB
/
credentials.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
exports.run = (client, message) => {
const Discord = require('discord.js');
const con = require('../utils/dbConnector');
const userid = message.author.id;
con.query(`SELECT * FROM users WHERE discord_id = '${userid}'`, (err, result) => {
const noCon = new Discord.MessageEmbed()
.setAuthor('CloudServer ¦ Credentials', client.user.avatarURL())
.setColor('FF0009')
.setFooter(`💕CloudServer Alpha | CodeCannibals\nRequested By ➤ ${message.author.tag}`, client.user.avatarURL())
.setDescription('```There was an error connecting to the database. Please report this issue to a member of the staffteam```');
if (err) return message.channel.send(noCon);
if (result.length == 0) {
const noReg = new Discord.MessageEmbed()
.setAuthor('CloudServer ¦ Credentials', client.user.avatarURL())
.setColor('FF0009')
.setFooter(`💕CloudServer Alpha | CodeCannibals\nRequested By ➤ ${message.author.tag}`, client.user.avatarURL())
.setDescription('```You are not a registered user. Please register yourself with ' + client.config.prefix + 'register to unlock this command```');
message.channel.send(noReg);
}
else {
const Database = JSON.parse(JSON.stringify(result[0]));
const sent = new Discord.MessageEmbed()
.setAuthor('CloudServer ¦ Credentials', client.user.avatarURL())
.setColor('DE4BFF')
.setFooter(`💕CloudServer Alpha | CodeCannibals\nRequested By ➤ ${message.author.tag}`, client.user.avatarURL())
.setDescription('```Your credentials has been sent to you```');
message.channel.send(sent);
const embed = new Discord.MessageEmbed()
.setAuthor('CloudServer ¦ Credentials', client.user.avatarURL())
.setColor('DE4BFF')
.setFooter(`💕CloudServer Alpha | CodeCannibals\nRequested By ➤ ${message.author.tag}`, client.user.avatarURL())
.setDescription('**__User Credentials For CloudServer__**```Email: ' + Database.email + '\nUsername: ' + Database.pterodactyl_username + '\nPassword: ' + Database.pterodactyl_password + '```');
message.author.send(embed);
}
});
};