-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
446 additions
and
411 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2019 | ||
}, | ||
"rules": { | ||
"brace-style": ["error", "stroustrup", { "allowSingleLine": true }], | ||
"comma-dangle": ["error", "always-multiline"], | ||
"comma-spacing": "error", | ||
"comma-style": "error", | ||
"curly": ["error", "multi-line", "consistent"], | ||
"dot-location": ["error", "property"], | ||
"handle-callback-err": "off", | ||
"indent": ["error", "tab"], | ||
"no-console": "off", | ||
"no-empty-function": "error", | ||
"no-floating-decimal": "error", | ||
"no-inline-comments": "error", | ||
"no-lonely-if": "error", | ||
"no-multi-spaces": "error", | ||
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], | ||
"no-shadow": ["error", { "allow": ["err", "resolve", "reject"] }], | ||
"no-trailing-spaces": ["error"], | ||
"no-var": "error", | ||
"object-curly-spacing": ["error", "always"], | ||
"prefer-const": "error", | ||
"quotes": ["error", "single"], | ||
"semi": ["error", "always"], | ||
"space-before-blocks": "error", | ||
"space-before-function-paren": ["error", { | ||
"anonymous": "never", | ||
"named": "never", | ||
"asyncArrow": "always" | ||
}], | ||
"space-in-parens": "error", | ||
"space-infix-ops": "error", | ||
"space-unary-ops": "error", | ||
"spaced-comment": "error", | ||
"yoda": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,42 @@ | ||
exports.run = (client, message, args) => { | ||
const Discord = require("discord.js"); | ||
const mysql = require('mysql') | ||
exports.run = (client, message) => { | ||
const Discord = require('discord.js'); | ||
const con = require('../utils/dbConnector'); | ||
|
||
const con = mysql.createConnection({ | ||
connectionLimit: 20, | ||
host: client.config.mysqlHOST, | ||
port: "3306", | ||
user: client.config.mysqlUSER, | ||
password: client.config.mysqlPASS, | ||
database: client.config.mysqlDB, | ||
}); | ||
|
||
var userid = message.author.id; | ||
con.query(`SELECT * FROM users WHERE discord_id = '${userid}'`, function (err, result, fields) { | ||
|
||
let 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```") | ||
const userid = message.author.id; | ||
con.query(`SELECT * FROM users WHERE discord_id = '${userid}'`, (err, result) => { | ||
|
||
if (err) return message.channel.send(noCon); | ||
|
||
if (result.length == 0) { | ||
let 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 { | ||
var Database = JSON.parse(JSON.stringify(result[0])); | ||
let 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); | ||
|
||
let 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); | ||
} | ||
}); | ||
} | ||
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); | ||
} | ||
}); | ||
}; |
Oops, something went wrong.