Skip to content

Instantly share code, notes, and snippets.

@TobiasFeld22
Created March 26, 2017 20:17
Show Gist options
  • Save TobiasFeld22/927037fcdb02af089e5ac29cd800ed5c to your computer and use it in GitHub Desktop.
Save TobiasFeld22/927037fcdb02af089e5ac29cd800ed5c to your computer and use it in GitHub Desktop.
progress?
var input = msg.content.split(" ")
if(input[0] == config.prefix + "accept"){
d = new Date();
if (client.guilds.get("294509304868896769").members.get(msg.author.id) == undefined){msg.channel.sendMessage("", {embed: {title: "You have no permission to execute this command!", description: "Only an **ADL Team Member** is able to do this.\nYou are: **ADL User**" , color: 0xff0000, footer: {text: ":no_entry: "}, timestamp: d}}); return}
else if (client.guilds.get("294509304868896769").members.get(msg.author.id).roles.get("295625073241620490") != undefined){msg.channel.sendMessage("", {embed: {title: "You have no permission to execute this command!", description: "Only an **ADL Team Member** is able to do this.\nYou are: **ADL User**" , color: 0xff0000, footer: {text: ":no_entry: "}, timestamp: d}}); return}
if (input[1] == null || IsNan(input[1]) == true){msg.channel.sendMessage(":1234: Please use a number"); return}
connection.query("select * from cases where cases = ?", [input[1]], function(err, results){
if (!err){
if (results[0] == undefined){msg.channel.sendMessage("This case number is not in my system, please try again with a different number."); return}
else{
msg.channel.sendMessage("Fetching Data, please be patient.").then((m) => {
if (results[0].type == "bot"){
connection.query("select * from bots where botId = ?", [results[0].id], function(err, results){
if (results[0] == undefined){msg.channel.sendMessage("Seems like some data is not complete, please contact an **ADL Manager** with the following data: \n```javascript\n"+JSON.stringify(results[0]) + "```"); return}
if (client.users.get(results[0].botId) == undefined || client.users.get(results[0].ownerId)){m.edit("Bot or owner is not in a server with ADL anymore, removing from database."); connection.query("delete * from bots where botId = ?", [results[0].botId]); connection.query("delete * from cases where cases = ?", [input[1]]); return}
var bot = client.users.get(results[0].botId)
var owner = client.users.get(results[0].ownerId)
if (results[0].prefixChange == 0){
var pfc = "false"
}else{
var pfc = "true"
}
m.edit("", {embed: {
color: 0x00A269,
title: "["+ input[1] + "] - Bot",
author: {
name: bot.username,
icon_url: bot.displayAvatarURL
},
fields:[
{name: "Bot id", value: bot.id, inline: true},
{name: "Bot owner", value: owner.username, inline: true},
{name: "Bot owner id", value: "owner.id", inline: true}
{name: "Prefix", value: results[0].prefix, inline: true},
{name: "Prefix changeable?", value: pfc, inline: true},
{name: "Short description", value: results[0].shortDesc, inline: false},
{name: "Description", value: results[0].description, inline: false}
]
}})
})
}else if (results[0].type == "server"){
}else{
msg.channel.sendMessage("Seems like some data is not complete, please contact an **ADL Manager** with the following data: \n```javascript\n"+JSON.stringify(results[0]) + "```");
return
}
})
}
}else{
console.log(err)
}
})
}
@AJFire14
Copy link

hmm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment