Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on("message", message => {
- let exshortcut = shortcuts[message.guild.id].avt;
- if (!message.channel.guild) return;
- if (message.content.startsWith (exshortcut)) {
- if (message.author.bot || message.channel.type == "dm") return;
- var args = message.content.split(" ")[1];
- var avt = args || message.author.id;
- client
- .fetchUser(avt)
- .then(user => {
- avt = user;
- let avtEmbed = new Discord.RichEmbed()
- .setColor("#36393e")
- .setAuthor(`${avt.username}'s Avatar`, message.author.avatarURL)
- .setImage(avt.avatarURL)
- .setFooter(`Earth Bot`, message.client.user.avatarURL);
- message.channel.send(avtEmbed);
- })
- .catch(() => message.channel.send(`Error`));
- }
- if (message.content.startsWith(".avt")) {
- if (message.author.bot || message.channel.type == "dm") return;
- var args = message.content.split(" ")[1];
- var avt = args || message.author.id;
- client
- .fetchUser(avt)
- .then(user => {
- avt = user;
- let avtEmbed = new Discord.RichEmbed()
- .setColor("#36393e")
- .setAuthor(`${avt.username}'s Avatar`, message.author.avatarURL)
- .setImage(avt.avatarURL)
- .setFooter(`Earth Bot`, message.client.user.avatarURL);
- message.channel.send(avtEmbed);
- })
- .catch(() => message.channel.send(`Error`));
- } // Julian
- }); // Codes - Toxic Codes
- client.on("message", msg => {
- if (msg.content === ".status") {
- msg.reply(
- "**<a:1111:662653433865568267> Main Commands Works** "
- );
- msg.reply(
- "**<a:1111:662653433865568267> Main Commands Works** "
- );
- }
- });
- client.on("message", msg => {
- if (msg.content === ".statuslist") {
- msg.reply(
- "**Main Commands | Profile And Credit | Protection | Giveaway | Report | Autorole** "
- );
- }
- });
- client.on("message", message => {
- if (shortcuts[message.guild.id] == undefined) {
- shortcuts[message.guild.id] = {
- clear: "none",
- ban: "none",
- kick: "none",
- mute: "none",
- unmute: "none",
- role: "none",
- contact: "none",
- move: "none",
- setlog: "none",
- bot: "none",
- user: "none",
- profile: "none",
- repuser: "none",
- credits: "none",
- daily: "none",
- avt: "none",
- avatar: "none",
- colors: "none",
- invite: "none",
- support: "none"
- }
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- }
- });
- function saveshortcut() {
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- }
- const shortcuts = JSON.parse(fs.readFileSync("./shortcuts.json", "utf8"));
- client.on("message" , message => {
- if (!message.channel.guild) return;
- let args = message.content.split(" ");
- let newcmd = args[2];
- let ag1 = args[1]
- if (message.content.startsWith (prefix + "setshortcut")) {
- if (!message.member.hasPermission("MANAGE_GUILD"))
- return message.channel.send(
- "**Sorry But You Dont Have Permission** `MANAGE_GUILD`"
- );
- if(!ag1) return message.channel.send("Sorry But Command Name Is Missing")
- if(!newcmd) return message.channel.send("Command Shortcut Missing")
- if(ag1 === "clear") {
- shortcuts[message.guild.id].clear = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }else if(ag1 === "ban") {
- shortcuts[message.guild.id].ban = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "kick") {
- shortcuts[message.guild.id].kick = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "mute") {
- shortcuts[message.guild.id].mute = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "unmute") {
- shortcuts[message.guild.id].unmute = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "role") {
- shortcuts[message.guild.id].role = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "contact") {
- shortcuts[message.guild.id].contact = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "moveall") {
- shortcuts[message.guild.id].move = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "bot") {
- shortcuts[message.guild.id].bot = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "user") {
- shortcuts[message.guild.id].user = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "avt") {
- shortcuts[message.guild.id].avt = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "avatar") {
- shortcuts[message.guild.id].avatar = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "colors") {
- shortcuts[message.guild.id].colors = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "invite") {
- shortcuts[message.guild.id].invite = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "support") {
- shortcuts[message.guild.id].support = newcmd
- fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
- if (err) throw err;
- });
- message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
- }
- else if(ag1 === "profile") {
- } else if(ag1 === "credits") {
- } else if(ag1 === "repuser") {
- } else if(ag1 === "daily") {
- }
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement