Advertisement
Guest User

Untitled

a guest
Nov 11th, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. const Discord = require("discord.js");
  2.  
  3. const mysql = require('mysql');
  4.  
  5. var con = mysql.createConnection({
  6. host: "localhost",
  7. user: "Website",
  8. password: "PASS",
  9. database: "discordverify"
  10. });
  11.  
  12. module.exports = {
  13. name: "upgrade",
  14. description: "Get a valid lsit of commands.",
  15. execute: (message, args) => {
  16.  
  17. con.connect(function(err) {
  18. if (err) throw err;
  19. setInterval(function(){
  20. con.query(`SELECT * FROM vip WHERE discord_name = '${message.author.username}'`, function (err, result2, fields2) {
  21. if(result2[0].completed == '1'){
  22. if(result2[0].botcompleted == '0'){
  23. var sql2 = `UPDATE vip SET botcompleted = '1' WHERE discord_name = '${message.author.username}'`;
  24. con.query(sql2, function (err, result3) {
  25. let viprole = message.guild.roles.find(`name`, "VIP");
  26. if (err) throw err;
  27. message.member.addRole(viprole.id);
  28. let img = "https://cdn.discordapp.com/attachments/397851090411847681/424512693819539456/wt.png";
  29. let thmb = "https://cdn.discordapp.com/attachments/397851090411847681/424512593844240396/t.png";
  30. let img2 = message.author.avatarURL;
  31. let embed = new Discord.RichEmbed()
  32. .setDescription("YulxVol, " + "[website](https://www.yulxvol.com/)")
  33. .addField("**Upgraded**", `Thank You ${message.author.username} for buying VIP and supporting YulxVol`, inline=true)
  34. .setImage("https://i.imgur.com/kBLwm9b.gif")
  35. .setThumbnail(img2)
  36. .setTimestamp("")
  37. .setFooter("© YulxVol" + " | yulxvol.com", img)
  38. .setColor("#a108a3");
  39. let upgradeschannel = message.guild.channels.find(`name`, "recent-upgrades");
  40.  
  41. upgradeschannel.send(embed);
  42. });
  43. }
  44. }
  45. });
  46. }, 5000);
  47.  
  48.  
  49.  
  50. });
  51.  
  52.  
  53.  
  54.  
  55.  
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement