Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.07 KB | None | 0 0
  1. client.on("message", message => {
  2. let exshortcut = shortcuts[message.guild.id].avt;
  3. if (!message.channel.guild) return;
  4. if (message.content.startsWith (exshortcut)) {
  5. if (message.author.bot || message.channel.type == "dm") return;
  6. var args = message.content.split(" ")[1];
  7. var avt = args || message.author.id;
  8. client
  9. .fetchUser(avt)
  10. .then(user => {
  11. avt = user;
  12. let avtEmbed = new Discord.RichEmbed()
  13. .setColor("#36393e")
  14. .setAuthor(`${avt.username}'s Avatar`, message.author.avatarURL)
  15. .setImage(avt.avatarURL)
  16. .setFooter(`Earth Bot`, message.client.user.avatarURL);
  17. message.channel.send(avtEmbed);
  18. })
  19. .catch(() => message.channel.send(`Error`));
  20. }
  21. if (message.content.startsWith(".avt")) {
  22. if (message.author.bot || message.channel.type == "dm") return;
  23. var args = message.content.split(" ")[1];
  24. var avt = args || message.author.id;
  25. client
  26. .fetchUser(avt)
  27. .then(user => {
  28. avt = user;
  29. let avtEmbed = new Discord.RichEmbed()
  30. .setColor("#36393e")
  31. .setAuthor(`${avt.username}'s Avatar`, message.author.avatarURL)
  32. .setImage(avt.avatarURL)
  33. .setFooter(`Earth Bot`, message.client.user.avatarURL);
  34. message.channel.send(avtEmbed);
  35. })
  36. .catch(() => message.channel.send(`Error`));
  37. } // Julian
  38. }); // Codes - Toxic Codes
  39.  
  40. client.on("message", msg => {
  41. if (msg.content === ".status") {
  42. msg.reply(
  43. "**<a:1111:662653433865568267> Main Commands Works** "
  44. );
  45. msg.reply(
  46. "**<a:1111:662653433865568267> Main Commands Works** "
  47. );
  48. }
  49. });
  50.  
  51.  
  52. client.on("message", msg => {
  53. if (msg.content === ".statuslist") {
  54. msg.reply(
  55. "**Main Commands | Profile And Credit | Protection | Giveaway | Report | Autorole** "
  56. );
  57. }
  58. });
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. client.on("message", message => {
  66. if (shortcuts[message.guild.id] == undefined) {
  67. shortcuts[message.guild.id] = {
  68. clear: "none",
  69. ban: "none",
  70. kick: "none",
  71. mute: "none",
  72. unmute: "none",
  73. role: "none",
  74. contact: "none",
  75. move: "none",
  76. setlog: "none",
  77. bot: "none",
  78. user: "none",
  79. profile: "none",
  80. repuser: "none",
  81. credits: "none",
  82. daily: "none",
  83. avt: "none",
  84. avatar: "none",
  85. colors: "none",
  86. invite: "none",
  87. support: "none"
  88.  
  89.  
  90. }
  91. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  92. if (err) throw err;
  93. });
  94. }
  95. });
  96.  
  97.  
  98.  
  99. function saveshortcut() {
  100. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  101. if (err) throw err;
  102. });
  103. }
  104.  
  105.  
  106.  
  107.  
  108.  
  109. const shortcuts = JSON.parse(fs.readFileSync("./shortcuts.json", "utf8"));
  110. client.on("message" , message => {
  111.  
  112. if (!message.channel.guild) return;
  113. let args = message.content.split(" ");
  114. let newcmd = args[2];
  115. let ag1 = args[1]
  116. if (message.content.startsWith (prefix + "setshortcut")) {
  117. if (!message.member.hasPermission("MANAGE_GUILD"))
  118. return message.channel.send(
  119. "**Sorry But You Dont Have Permission** `MANAGE_GUILD`"
  120. );
  121. if(!ag1) return message.channel.send("Sorry But Command Name Is Missing")
  122. if(!newcmd) return message.channel.send("Command Shortcut Missing")
  123. if(ag1 === "clear") {
  124. shortcuts[message.guild.id].clear = newcmd
  125. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  126. if (err) throw err;
  127. });
  128. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  129.  
  130. }else if(ag1 === "ban") {
  131. shortcuts[message.guild.id].ban = newcmd
  132. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  133. if (err) throw err;
  134. });
  135. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  136. }
  137. else if(ag1 === "kick") {
  138. shortcuts[message.guild.id].kick = newcmd
  139. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  140. if (err) throw err;
  141. });
  142. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  143. }
  144. else if(ag1 === "mute") {
  145. shortcuts[message.guild.id].mute = newcmd
  146. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  147. if (err) throw err;
  148. });
  149. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  150. }
  151. else if(ag1 === "unmute") {
  152. shortcuts[message.guild.id].unmute = newcmd
  153. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  154. if (err) throw err;
  155. });
  156. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  157. }
  158. else if(ag1 === "role") {
  159. shortcuts[message.guild.id].role = newcmd
  160. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  161. if (err) throw err;
  162. });
  163. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  164. }
  165. else if(ag1 === "contact") {
  166. shortcuts[message.guild.id].contact = newcmd
  167. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  168. if (err) throw err;
  169. });
  170. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  171. }
  172.  
  173. else if(ag1 === "moveall") {
  174. shortcuts[message.guild.id].move = newcmd
  175. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  176. if (err) throw err;
  177. });
  178. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  179. }
  180.  
  181. else if(ag1 === "bot") {
  182. shortcuts[message.guild.id].bot = newcmd
  183. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  184. if (err) throw err;
  185. });
  186. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  187. }
  188.  
  189. else if(ag1 === "user") {
  190. shortcuts[message.guild.id].user = newcmd
  191. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  192. if (err) throw err;
  193. });
  194. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  195. }
  196.  
  197. else if(ag1 === "avt") {
  198. shortcuts[message.guild.id].avt = newcmd
  199. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  200. if (err) throw err;
  201. });
  202. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  203. }
  204.  
  205. else if(ag1 === "avatar") {
  206. shortcuts[message.guild.id].avatar = newcmd
  207. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  208. if (err) throw err;
  209. });
  210. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  211. }
  212.  
  213. else if(ag1 === "colors") {
  214. shortcuts[message.guild.id].colors = newcmd
  215. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  216. if (err) throw err;
  217. });
  218. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  219. }
  220.  
  221. else if(ag1 === "invite") {
  222. shortcuts[message.guild.id].invite = newcmd
  223. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  224. if (err) throw err;
  225. });
  226. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  227. }
  228.  
  229. else if(ag1 === "support") {
  230. shortcuts[message.guild.id].support = newcmd
  231. fs.writeFile("./shortcuts.json", JSON.stringify(shortcuts), function(err) {
  232. if (err) throw err;
  233. });
  234. message.channel.send(`**Done Sir Changed That Command shortcut to : ${newcmd}**`)
  235. }
  236. else if(ag1 === "profile") {
  237.  
  238. } else if(ag1 === "credits") {
  239.  
  240. } else if(ag1 === "repuser") {
  241.  
  242. } else if(ag1 === "daily") {
  243.  
  244. }
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254. }
  255. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement