Advertisement
Guest User

Untitled

a guest
Aug 4th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.33 KB | None | 0 0
  1. // FleetUtil for Fleet Girls Online
  2. // v0.0.1
  3. // by Karen
  4.  
  5. const Discord = require("discord.js");
  6. const mysql = require("mysql");
  7. const fs = require("fs");
  8.  
  9. const config = require("./config.json");
  10. const token = config.token;
  11. const prefix = config.prefix;
  12.  
  13. const bot = new Discord.Client({autoReconnect:true});
  14.  
  15. // Bot status, invite and console invitation
  16. bot.on("ready", async () => {
  17. bot.user.setStatus("playing")
  18. bot.user.setActivity("the coastline!", { type: "WATCHING" })
  19. console.log();
  20. console.log(`${bot.user.username} is now up and running!`);
  21. console.log(`Assisting ${bot.users.size} users in Fleet Girls Online!`);
  22. console.log("Invite link below with permissions set as administrator.");
  23. try {
  24. let link = await bot.generateInvite(["ADMINISTRATOR"])
  25. console.log(link);
  26. } catch(e) {
  27. console.log(e.stack);
  28. };
  29. });
  30. bot.on("message", message => {
  31. if (message.author.bot) return;
  32. let author = message.author.username
  33. let content = message.content
  34. console.log(`${author}: ${content}`);
  35. });
  36.  
  37. // Connects to the fleet database
  38. var con = mysql.createConnection({
  39. host: "localhost",
  40. user: "root",
  41. password: "karen",
  42. database: "fleet"
  43. });
  44. con.connect(err => {
  45. if(err) throw err;
  46. con.query("SHOW TABLES", console.log)
  47. console.log("Connected to database!");
  48. });
  49.  
  50. function clamp (v, min, max) {
  51. return (Math.min(max, Math.max(min, v)));
  52. }
  53.  
  54.  
  55. const ships = require("./ships.json");
  56. //const construction = require("./construction")
  57.  
  58.  
  59. bot.on("message", async message => {
  60. if (message.author.bot) return;
  61. if (message.channel.type === "dm") return;
  62. if (!message.content.startsWith(prefix)) return;
  63. //if (message.member.roles.find("name", "Non-Registered Member")) return message.channel.send("You have not yet registered");
  64. const args = message.content.slice(prefix.length).trim().split(/ +/g);
  65. const command = args.shift().toLowerCase();
  66.  
  67. // Icons/Emotes ----------------------------------
  68. let IconCoin = bot.emojis.find("name", "IconCoin")
  69. let IconFuel = bot.emojis.find("name", "IconFuel")
  70. let IconRuby = bot.emojis.find("name", "IconRuby")
  71. let IconCube = bot.emojis.find("name", "IconCube")
  72. let IconDrill = bot.emojis.find("name", "IconDrill")
  73.  
  74. let ShipSS = bot.emojis.find("name", "ShipSS")
  75. let ShipDD = bot.emojis.find("name", "ShipDD")
  76. let ShipCX = bot.emojis.find("name", "ShipCX")
  77. let ShipCV = bot.emojis.find("name", "ShipCV")
  78. let ShipBB = bot.emojis.find("name", "ShipBB")
  79.  
  80. //let rrole = message.member.roles.find("name", "Registered Member")
  81. //let nrole = message.member.roles.find("name", "Non-Registered Member")
  82. //let rrmsg = message.channel.send("You have already registered")
  83. //let nrmsg = message.channel.send("You have not yet registered")
  84.  
  85. // Command H01 "Help" ------------
  86. if (command === "help") {
  87. let h01Script = require("./script/help.json");
  88. if (!args[0]) return message.channel.send(helpScript.blank);
  89. if (args[0] === "help") return message.channel.send(h01Script.help)
  90. if (args[0] === "register") return message.channel.send(h01Script.register)
  91. if (args[0] === "refuel") return message.channel.send(h01Script.refuel)
  92. if (args[0] === "upgrade") return message.channel.send(h01Script.upgrade)
  93. message.channel.send(helpScript.other);
  94. }
  95. // Command R01 "Register" --------
  96. if (command === "register") {
  97. let r01Script = require("./script/register.json");
  98. let sqlFill = "DELETE FROM fill"
  99. let sqlAccount = "(id, coin, fuel, ruby, blue, drill, fuelup, secretary)"
  100. let RRole = message.guild.roles.find("name", "Registered Member")
  101. let NRole = message.guild.roles.find("name", "Non-Registered Member")mico
  102. let dWelcome = "Welcome to **Fleet Girls Online** "
  103. let dHelp = "\n\n`Type in ;info to view your account and ;help for asssistance.`"
  104. if (message.member.roles.find("name", "Registered Member")) return message.channel.send("You have already registered, theres no need to register again.");
  105. // Selection -------------------------------
  106. let embedSelection = new Discord.RichEmbed()
  107. .setTitle("Registration")
  108. .setDescription(r01Script.selection.desc)
  109. .addField("Starters", r01Script.selection.field)
  110. .setImage(r01Script.selection.image)
  111. .setColor(0x9ffff9);
  112. if (!args[0]) return message.channel.send(embedSelection);
  113. // Ayanami -------------------------------
  114. if (args[0].toLowerCase() === "ayanami") {
  115. let embedAyanami = new Discord.RichEmbed()
  116. .setTitle("You have now registered!")
  117. .setDescription(`${dWelcome}${message.author.username}!\n${r01Script.ayanami.desc}${dHelp}`)
  118. .setThumbnail(r01Script.ayanami.thumbnail)
  119. .setColor(0x9ffff9);
  120. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  121. if (err) throw err; let sql1; let sql2;
  122. if (rows.length < 1) {
  123. sql1 = `INSERT INTO account ${sqlAccount} VALUES ('${message.author.id}', 5000, 1500, 1000, 1, 1, 1, 'ayanami')`
  124. sql2 = `INSERT INTO stats (id) VALUES ('${message.author.id}')`
  125. message.member.addRole(RRole); message.member.removeRole(NRole)
  126. message.channel.send(embedAyanami)
  127. } else {
  128. sql1 = sqlFill; sql2 = sqlFill
  129. message.channel.send("You have already registered, theres no need to register again.")
  130. }
  131. con.query(sql1); con.query(sql2);
  132. });
  133. } else {
  134. // Laffey -------------------------------
  135. if (args[0].toLowerCase() === "laffey") {
  136. let embedLaffey = new Discord.RichEmbed()
  137. .setTitle("You have now registered!")
  138. .setDescription(`${dWelcome}${message.author.username}!\n${r01Script.laffey.desc}${dHelp}`)
  139. .setThumbnail(r01Script.laffey.thumbnail)
  140. .setColor(0x9ffff9);
  141. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  142. if (err) throw err; let sql1; let sql2;
  143. if (rows.length < 1) {
  144. sql1 = `INSERT INTO account ${sqlAccount} VALUES ('${message.author.id}', 5000, 1500, 1000, 1, 1, 1, 'laffey')`
  145. sql2 = `INSERT INTO stats (id) VALUES ('${message.author.id}')`
  146. message.member.addRole(RRole)
  147. message.member.removeRole(NRole)
  148. message.channel.send(embedLaffey)
  149. } else {
  150. sql1 = sqlFill; sql2 = sqlFill
  151. message.channel.send("You have already registered, theres no need to register again.")
  152. }
  153. con.query(sql1); con.query(sql2);
  154. });
  155. } else {
  156. // Javelin -------------------------------
  157. if (args[0].toLowerCase() === "javelin") {
  158. let embedJavelin = +new Discord.RichEmbed()
  159. .setTitle("You have now registered!")
  160. .setDescription(`${dWelcome}${message.author.username}!\n${r01Script.javelin.desc}${dHelp}`)
  161. .setThumbnail(r01Script.javelin.thumbnail)
  162. .setColor(0x9ffff9);
  163. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  164. if (err) throw err; let sql1; let sql2;
  165. if (rows.length < 1) {
  166. sql1 = `INSERT INTO account ${sqlAccount} VALUES ('${message.author.id}', 5000, 1500, 1000, 1, 1, 1, 'javelin')`
  167. sql2 = `INSERT INTO stats (id) VALUES ('${message.author.id}')`
  168. message.member.addRole(RRole)
  169. message.member.removeRole(NRole)
  170. message.channel.send(embedJavelin)
  171. } else {
  172. sql1 = sqlFill; sql2 = sqlFill
  173. message.channel.send("You have already registered, theres no need to register again.")
  174. }
  175. con.query(sql1); con.query(sql2);
  176. });
  177. } else {
  178. // Selecetion ----------------------
  179. message.channel.send(embedSelection)
  180. }}}
  181. }
  182. // Command TXX "NULL" ------------
  183. if (command === "retired-pick") {
  184. if(!args[0]) return message.channel.send("What is it that you want to pick?");
  185. let starters = ["murakumo", "inazuma", "fubuki", "samidare", "sazanami"]
  186. if (args[0].toLowerCase() === starters) return message.channel.send("Please choose a starter!")
  187. con.query(`SELECT * FROM stats WHERE id = '${message.author.id}'`, (err, rows) => {
  188. if (err) throw err;
  189. let sql;
  190. if (rows.length < 1) {
  191. sql = `INSERT INTO fill (fill) VALUES ('fill')`
  192. sql = `DELETE FROM fill`
  193. message.channel.send("You first need to register!");
  194. } else {
  195. sql = `UPDATE stats SET ship = '${args[0].toLowerCase()}' WHERE id = '${message.author.id}'`;
  196. message.channel.send(`You have set ${args[0]} as your starter!`)
  197. }
  198. con.query(sql);
  199. });
  200. }
  201. if (command === "retired-simg") {
  202. if (!args[0]) return message.channel.send("Please mention a ship so I could display her info!")
  203. con.query(`SELECT * FROM shiplist WHERE name = '${args[0].toLowerCase()}'`, (err, rows) => {
  204. if (rows.length < 1) {
  205. message.channel.send("That is not an actual ship! In-game that is...");
  206. } else {
  207. let nm = rows[0].name; let name = nm.charAt(0).toUpperCase() + nm.slice(1);
  208. let nation = rows[0].nation; let type = rows[0].type; let clas = rows[0].class;
  209. let desc = rows[0].desc; let imgcard = rows[0].imgcard;
  210. if (rows[0].intro === "filler") return message.channel.send("Tell Karen to fucking add it smh")
  211. let embed = new Discord.RichEmbed()
  212. .addField(`[${nation}] ${name}`, `${type} ${clas} class`)
  213. .addField("Description", desc)
  214. .setImage(imgcard)
  215. .setColor(0xFFFFFF)
  216. message.channel.send(embed)
  217. }
  218. });
  219. }
  220. if (command === "retired-sdmg") {
  221. if (!args[0]) return message.channel.send("Sadist...")
  222. con.query(`SELECT * FROM shiplist WHERE name = '${args[0].toLowerCase()}'`, (err, rows) => {
  223. if (rows.length < 1) {
  224. message.channel.send("Sadist...");
  225. } else {
  226. let nm = rows[0].name; let name = nm.charAt(0).toUpperCase() + nm.slice(1);
  227. let dmg = rows[0].dmg; let imgcarddmg = rows[0].imgcarddmg;
  228. if (rows[0].intro === "filler") return message.channel.send("Tell Karen to fucking add it smh")
  229. let embed = new Discord.RichEmbed()
  230. .addField(name, dmg)
  231. .setImage(imgcarddmg)
  232. .setColor(0xFFFFFF)
  233. message.channel.send(embed)
  234. }
  235. });
  236. }
  237. if (command === "retired-sbnr") {
  238. if (!args[0]) return message.channel.send("Specify a ship.")
  239. con.query(`SELECT * FROM shiplist WHERE name = '${args[0].toLowerCase()}'`, (err, rows) => {
  240. if (rows.length < 1) {
  241. message.channel.send("The ship was not found.");
  242. } else {
  243. let nm = rows[0].name; let name = nm.charAt(0).toUpperCase() + nm.slice(1);
  244. let dmg = rows[0].dmg; let imgcardbnr = rows[0].imgbanner;
  245. if (rows[0].intro === "filler") return message.channel.send("Tell Karen to fucking add it smh")
  246. let embed = new Discord.RichEmbed()
  247. .addField(name, "Banner is shown in combat.")
  248. .setImage(imgcardbnr)
  249. .setColor(0xFFFFFF)
  250. message.channel.send(embed)
  251. }
  252. });
  253. }
  254. if (command === "retired-list") {
  255. con.query(`SELECT * FROM shiplist`, (err, rows) => {
  256. let hgf = rows.name
  257. message.channel.send(hgf.toString())
  258. });
  259. }
  260. // Command R02 "Refuel" ----------
  261. if (command === "refuel") {
  262. let sqlFill = "DELETE FROM fill"
  263. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  264. if (err) throw err; let sql;
  265. if (rows.length < 1) {
  266. sql = sqlFill
  267. message.channel.send("You first need to register!");
  268. } else {
  269. let fuel = rows[0].fuel;
  270. let fuelup = rows[0].fuelup;
  271. sql = `UPDATE account SET fuel = ${fuel+75+(fuelup*25)} WHERE id = '${message.author.id}'`;
  272. message.channel.send(`You have refueled **${75+(fuelup*25)}**${IconFuel} !`)
  273. }
  274. con.query(sql);
  275. });
  276. }
  277. // Command TXX "Ship" ------------
  278. if (command === "ship") {
  279. if (!args[0]) return message.channel.send("Specify a ship.")
  280. con.query(`SELECT * FROM azurlist WHERE source = '${message.content.toLowerCase().replace(";ship ", "").replace(" ", "")}'`, (err, rows) => {
  281. if (rows.length < 1) {
  282. message.channel.send("That's not an actual ship!");
  283. } else {
  284. let id = rows[0].id; let source = rows[0].source; let name = rows[0].name;
  285. let type1 = rows[0].type1; let type2 = rows[0].type2; let type3 = rows[0].type3;
  286. let nation1 = rows[0].nation1; let nation2 = rows[0].nation2; let nation3 = rows[0].nation3;
  287. let rarity1 = rows[0].rarity1; let rarity2 = rows[0].rarity2; let rarity3 = rows[0].rarity3;
  288. let status1 = rows[0].status1; let status2 = rows[0].status2;
  289. let thumbnail = rows[0].thumbnail; let image = rows[0].imagecg;
  290. let type4 = bot.emojis.find("name", `${type3}`)
  291. //let type4 = eval('({' + str + '})');
  292. let embed = new Discord.RichEmbed()
  293. .setTitle(`[${status1}] ${name}`)
  294. .setDescription(`${name} is a ${type2} from the ${nation2}.\nShe has a ${rarity2} rarity and can be obtained through construction.`)
  295. .addField("Type", `[**${type1}**] ${type4}${type2}`)
  296. .addField("Rarity", `[**${rarity1}**] ${rarity2}`)
  297. .addField("Nation", `[**${nation1}**] ${nation2}`)
  298. .setThumbnail(thumbnail)
  299. .setImage(image)
  300. .setColor(0x9ffff9)
  301. message.channel.send(embed)
  302. }
  303. });
  304. }
  305. // Command TXX "Ship" ------------
  306. if (command === "myship") {
  307. if (!args[0]) return message.channel.send("Specify a ship.")
  308. con.query(`SELECT * FROM azurlist WHERE source = '${message.content.toLowerCase().replace(";ship ", "").replace(" ", "")}'`, (err, rows) => {
  309. if (rows.length < 1) {
  310. message.channel.send("That's not an actual ship!");
  311. } else {
  312. let id = rows[0].id; let source = rows[0].source; let name = rows[0].name;
  313. let type1 = rows[0].type1; let type2 = rows[0].type2; let type3 = rows[0].type3;
  314. let nation1 = rows[0].nation1; let nation2 = rows[0].nation2; let nation3 = rows[0].nation3;
  315. let rarity1 = rows[0].rarity1; let rarity2 = rows[0].rarity2; let rarity3 = rows[0].rarity3;
  316. let status1 = rows[0].status1; let status2 = rows[0].status2;
  317. let thumbnail = rows[0].thumbnail; let image = rows[0].imagecg;
  318. let type4 = bot.emojis.find("name", `${type3}`)
  319. //let type4 = eval('({' + str + '})');
  320. let embed = new Discord.RichEmbed()
  321. .setTitle(`[${status1}] ${name}`)
  322. .setDescription(`${name} is a ${type2} from the ${nation2}.\nShe has a ${rarity2} rarity and can be obtained through construction.`)
  323. .addField("Type", `[**${type1}**] ${type4}${type2}`)
  324. .addField("Rarity", `[**${rarity1}**] ${rarity2}`)
  325. .addField("Nation", `[**${nation1}**] ${nation2}`)
  326. .setThumbnail(thumbnail)
  327. .setImage(image)
  328. .setColor(0x9ffff9)
  329. message.channel.send(embed)
  330. }
  331. });
  332. }
  333. // Command TXX "Tcoin" -----------
  334. if (command === "tcoin") {
  335. let sqlFill = "DELETE FROM fill"
  336. if (isNaN(args[0])) return message.channel.send("numbers fag");
  337. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  338. if (err) throw err; let sql;
  339. if (rows.length < 1) {
  340. sql = sqlFill
  341. message.channel.send("You first need to register!");
  342. } else {
  343. let coin = rows[0].coin;
  344. sql = `UPDATE account SET coin = ${clamp(coin + Number(args[0]), -9999999, 9999999)} WHERE id = '${message.author.id}'`;
  345. message.channel.send(`given ${clamp(Number(args[0]), -9999999, 9999999)} coins to your bal nts remove command`)
  346. }
  347. con.query(sql);
  348. });
  349. }
  350. // Command U01 "Upgrade" ---------
  351. if (command === "upgrade") {
  352. let sqlfill = `DELETE FROM fill`
  353. if (message.member.roles.find("name", "Non-Registered Member")) return message.channel.send("You have not registered");
  354. if (!args[0]) return message.channel.send("`Type in ;help upgrade for assistance.`");
  355. // Upgrade for fuel
  356. if (args[0].toLowerCase() === "fuel") {
  357. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  358. if (err) throw err; let sql1; let sql2;
  359. if (rows.length < 1) {
  360. sql1 = sqlfill; sql2 = sqlfill
  361. message.channel.send("You first need to register!");
  362. } else {
  363. let coin = rows[0].coin;
  364. let fuel = rows[0].fuel;
  365. let fuelup = rows[0].fuelup;
  366. if (coin >= fuelup*500) {
  367. sql1 = `UPDATE account SET coin = ${coin-(fuelup*500)} WHERE id = '${message.author.id}'`
  368. sql2 = `UPDATE account SET fuelup = ${fuelup+1} WHERE id = '${message.author.id}'`;
  369. message.channel.send(`You have upgraded your tank to yield more fuel!\nIt costed you ${fuelup*500} coins!\nRefuel level ${fuelup+1}`)
  370. } else {
  371. sql1 = sqlfill; sql2 = sqlfill
  372. message.channel.send(`You dont have enough coins! You need ${fuelup*500} coins to upgrade`)
  373. }
  374. }
  375. con.query(sql1); con.query(sql2);
  376. });
  377. } else {
  378. // Upgrade others
  379. message.channel.send("`You can only upgrade your fuel station atm`")
  380. }
  381. }
  382. // Command E01 "Expedition" ------
  383. if (command === "expedition") {
  384. let sqlfill = `DELETE FROM fill`
  385. if (message.member.roles.find("name", "Non-Registered Member")) return message.channel.send("You have not registered");
  386. if (!args[0]) return message.channel.send("`Type in ;help upgrade for assistance.`");
  387. // Upgrade for fuel
  388. if (args[0].toLowerCase() === "fuel") {
  389. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  390. let coin = rows[0].coin;
  391. let fuel = rows[0].fuel;
  392. let fuelup = rows[0].fuelup;
  393. if (err) throw err;
  394. let sql1; let sql2;
  395. if (rows.length < 1) {
  396. sql1 = sqlfill; sql2 = sqlfill
  397. message.channel.send("You first need to register!");
  398. } else {
  399. if (coin >= fuelup*500) {
  400. sql1 = `UPDATE account SET coin = ${coin-(fuelup*500)} WHERE id = '${message.author.id}'`
  401. sql2 = `UPDATE account SET fuelup = ${fuelup+1} WHERE id = '${message.author.id}'`;
  402. message.channel.send(`You have upgraded your tank to yield more fuel!\nIt costed you ${fuelup*500} coins!\nRefuel level ${fuelup+1}`)
  403. } else {
  404. sql1 = sqlfill; sql2 = sqlfill
  405. message.channel.send(`You dont have enough coins! You need ${fuelup*500} coins to upgrade`)
  406. }
  407. }
  408. con.query(sql1); con.query(sql2);
  409. });
  410. } else {
  411. // Upgrade others
  412. message.channel.send("`You can only upgrade your fuel station atm`")
  413. }
  414. }
  415. // Command I01 "Information" -----
  416. if (command === "info") {
  417. con.query(`SELECT * FROM account WHERE id = '${message.author.id}'`, (err, rows) => {
  418. if (err) throw err;
  419. if (rows.length < 1) {
  420. message.channel.send("You first need to register!");
  421. } else {
  422. let coin = rows[0].coin; let fuel = rows[0].fuel; let ruby = rows[0].ruby;
  423. let cube = rows[0].blue; let drill = rows[0].drill;
  424. let fuelup = rows[0].fuelup;
  425. let secretary = rows[0].secretary;
  426. let embed = new Discord.RichEmbed()
  427. .setTitle(`${message.author.username}'s account`)
  428. // .setDescription(`${message.author.username}, you currently have ${coin} coins, ${fuel}, fuel and ${ruby} rubies! Your current secretary ship is ----`)
  429. .setDescription(`Refuel station level ${fuelup}.\nYou get ${75+(fuelup*25)} per refuel`)
  430. .addField("Balance and Fuel", `**${coin}** ${IconCoin} **${fuel}** ${IconFuel} **${ruby}** ${IconRuby}`)
  431. // .addField("Coin", `**${coin}** ${IconCoin}`)
  432. // .addField("Fuel", `**${fuel}** ${IconFuel}`)
  433. // .addField("Ruby", `**${ruby}** ${IconRuby}`)
  434. .addField("Construction Materials", `**${cube}** ${IconCube} **${drill}** ${IconDrill}`)
  435. .addField("Secretary Ship", secretary)
  436. .setThumbnail(message.author.avatarURL)
  437. .setColor(0x9ffff9)
  438. message.channel.send(embed)
  439. }
  440. });
  441. }
  442. // --------END-----------------------
  443. });
  444.  
  445.  
  446.  
  447.  
  448. bot.on("message", async message => {
  449. if (message.author.bot) return;
  450. if (message.channel.type === "dm") return;
  451. if (!message.content.startsWith(prefix)) return;
  452. const args = message.content.slice(prefix.length).trim().split(/ +/g);
  453. const command = args.shift().toLowerCase();
  454.  
  455. if (command === "test") {
  456. let embed = new Discord.RichEmbed()
  457. .setTitle(`${message.author.username}'s account`)
  458. .setThumbnail("https://azurlane.koumakan.jp/w/images/thumb/0/0c/Universal_BullinShipyardIcon.png/100px-Universal_BullinShipyardIcon.png")
  459. .setImage("https://azurlane.koumakan.jp/w/images/thumb/0/0c/Universal_BullinShipyardIcon.png/100px-Universal_BullinShipyardIcon.png")
  460. message.channel.send(embed)
  461. }
  462.  
  463. if (command === "cleardb") {
  464. con.query(`DELETE FROM account WHERE id;`);
  465. con.query(`DELETE FROM stats;`);
  466. message.channel.send("Cleared databse nts; remove this command when done debugging")
  467. }
  468.  
  469. if (command === "clearrole") {
  470. let RRole = message.guild.roles.find("name", "Registered Member")
  471. let NRole = message.guild.roles.find("name", "Non-Registered Member")
  472. message.member.removeRole(RRole)
  473. message.member.addRole(NRole)
  474. message.channel.send("Reset your role nts; remove this command when done debugging")
  475. }
  476.  
  477. if (command === "clearall") {
  478. con.query(`DELETE FROM account;`);
  479. con.query(`DELETE FROM stats;`);
  480. let RRole = message.guild.roles.find("name", "Registered Member")
  481. let NRole = message.guild.roles.find("name", "Non-Registered Member")
  482. message.member.removeRole(RRole)
  483. message.member.addRole(NRole)
  484. message.channel.send("Cleared databse and your role has been reset nts; remove this command when done debugging")
  485. }
  486. });
  487.  
  488. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement