gaber-elsayed

buy roles

Sep 9th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.41 KB | None | 0 0
  1. client.on("message", message => {
  2. if (message.author.bot) return;
  3.  
  4. if (message.content === prefix + "help") {
  5. message.channel.send(`**اوامـر الـبوت
  6. ● | ${prefix}buy sfa/nfa amount -> لشراء حساب
  7. ● | ${prefix}stock -> لمعرفة كمية الحسابات المتوفرة
  8. ● | ${prefix}add sfa/nfa email pass -> لاضافة حساب للبوت
  9. ● | ${prefix}give mention sfa/nfa amount -> لإرسال حساب لشخص
  10. **`);
  11. }
  12. });
  13.  
  14.  
  15.  
  16.  
  17.  
  18. const cools = [];
  19. let sfa = JSON.parse(fs.readFileSync('./sfa.json', 'utf8')); // الملف الي بتحط به الحسابات الفل داتا
  20. let nfa = JSON.parse(fs.readFileSync('./nfa.json', 'utf8')); // الملف الي بتحط به الحسابات العاديه
  21. let SFAP = 9000; /*سعر الحساب الواحد الفل داتا*/
  22. let NFAP = 2500; /*سعر الحساب الواحد العادي*/
  23. let URID = '585217195756486656' //مين بيتحوله الكريديت
  24. client.on('message', async message => {
  25. let bOn = await db.fetch(`bOn_${message.guild.id}`)
  26. if (message == prefix + 'stock') {
  27. let ahmed = 0;
  28. let hossam = 0;
  29.  
  30. if (bOn === "off") return message.reply("**Sorry, Buying mode are disabled**")
  31.  
  32. sfa.forEach(acc => {
  33. if (!acc.email) return;
  34. ahmed++;
  35. });
  36. nfa.forEach(acc => {
  37. if (!acc.email) return;
  38. hossam++;
  39. });
  40. message.channel.send(new Discord.RichEmbed().setTitle('💵 Stars Shop 💵') ///1
  41. .addField('**[SFA | فل داتا] > **', `**${ahmed} Account(s)**`, true).addField('**[NFA | عادي] > **', `**${hossam} Account(s) **`, true).setColor('GREEN')
  42. .addField('**هل تعلم ؟**', `**\`[SFA]\` > فل داتا - حساب يمكنك اللعب وتغيير الاسم والباسوورد والسكن
  43. \`[NFA]\` > العادي = حساب لا يمكنك تغيير اي شيئ فيه, للعب فقط**`)
  44. .addField('**الاسعار**', `\`[1 SFA] > ${SFAP} Credits ProBot\` \n \`[1 NFA] > ${NFAP} Credits ProBot\``)
  45. .setFooter(`$buy [sfa/nfa] [الحسابات لا يوجد عليها ضمان | لشراء حساب الرجاء كتابة الأمر التالي [الكمية`))
  46. }
  47. if (message.content.startsWith(prefix + 'buy')) {
  48. if (bOn === "off") return message.reply("**Sorry, Buying mode are disabled**")
  49.  
  50. let cmd = message.content.split(" ")[1];
  51. let args = message.content.split(" ")[2];
  52. if (!cmd || !args || isNaN(args)) return message.channel.send(`**Correct Usage Example: ${prefix}buy SFA 1**`); ///2
  53. if (cmd == 'sfa') {
  54. if (cools [message.author.id + message.guild.id] && cools [message.author.id + message.guild.id].status == "on")return message.reply("**لديك عملية شراء بل فعل.**");
  55. let ahmed = 0
  56. sfa.forEach(acc => {
  57. if (!acc.email) return;
  58. ahmed++;
  59. });
  60. if (ahmed < 1) return message.channel.send("لا يوجد حسابات")
  61. if (ahmed < args) return message.channel.send("لا يوجد حسابات كافية") //
  62. message.author.send('✅ Nothing.. Just Check If Your DM open or no').then(() => {
  63.  
  64.  
  65. cools[message.author.id + message.guild.id] = {
  66. status: "on"
  67. };
  68. let P = Math.floor(args * (SFAP))
  69. message.channel.send(new Discord.RichEmbed().setAuthor(message.author.tag, message.author.avatarURL).setColor('#918383')
  70. .setDescription(`**اكتب الامر التالي لأكمال عمليه الشراء
  71. #credits <@${URID}> ${P}
  72. لديك 3 دقائق قبل الالغاء.**`));
  73. let P2 = Math.floor(P - (P * (5 / 100)));///3
  74. let filter = response => response.author.id == "282859044593598464" && response.mentions._content.includes(`**:moneybag: | ${message.author.username}, has transferred \`$${P2}\` to <@${URID}> **`);
  75. message.channel.awaitMessages(filter, {
  76. maxMatches: 1,
  77. time: 240000,
  78. errors: ['time']
  79. })
  80. .then(collected => {
  81. let C = 0;
  82. let Accs = [];
  83. sfa.forEach(acc => {
  84. if (!acc.email) return;
  85. if (C == args) return;;
  86. Accs.push(`Email: ${acc.email} | pass: ${acc.pass}`);
  87. C++;
  88. delete acc.email;
  89. delete acc.pass;
  90. fs.writeFile("./sfa.json", JSON.stringify(sfa), (err) => {
  91. if (err) console.error(err)
  92. })
  93. });
  94. delete cools [message.author.id + message.guild.id];
  95. message.channel.send('**Done,,\nNow Check Your DM**!')
  96. message.author.send(`Your Accs :)\`\`\`json\n${Accs.join("\n")}\n\`\`\`سيتم حذف الرساله بعد 5 دقائق !`).then(M => M.delete(5 * 60 * 1000))
  97. });
  98. }).catch(err => {
  99. delete cools [message.author.id + message.guild.id];
  100. return message.channel.send('**:x: Please Open Your DM**!')
  101. })
  102. }
  103. if (cmd == 'nfa') {
  104. if (cools [message.author.id + message.guild.id] && cools [message.author.id + message.guild.id].status == "on")return message.reply("**لديك عملية شراء بل فعل.**");
  105.  
  106. let ahmed = 0;
  107. nfa.forEach(acc => {
  108. if (!acc.email) return;
  109. ahmed++;
  110. })
  111. if (ahmed < 1) return message.channel.send("لا يوجد حسابات")
  112. if (ahmed < args) return message.channel.send("لا يوجد حسابات كافية")
  113. message.author.send('✅ Nothing.. Just Check If Your DM open or no').then(() => {
  114. let P = Math.floor(args * (NFAP))
  115. cools[message.author.id + message.guild.id] = {
  116. status: "on"
  117. };
  118. let P3 = Math.floor(args * (NFAP))
  119. message.channel.send(new Discord.RichEmbed().setAuthor(message.author.tag, message.author.avatarURL).setColor('#918383')
  120. .setDescription(`**اكتب الامر التالي لأكمال عمليه الشراء
  121. #credits <@${URID}> ${P3}
  122. لديك 3 دقائق قبل الالغاء.**`));
  123. P = Math.floor(P3 - (P3 * (5 / 100))); ///4
  124. let filter = response => response.author.id == "282859044593598464" && response.mentions._content.includes(`**:moneybag: | ${message.author.username}, has transferred \`$${P}\` to <@${URID}> **`);
  125. message.channel.awaitMessages(filter, {
  126. maxMatches: 1,
  127. time: 240000,
  128. errors: ['time']
  129. })
  130. .then(collected => {
  131. let C = 0;
  132. let Accs = [];
  133. nfa.forEach(acc => {
  134. if (!acc.email) return;
  135. if (C == args) return;;
  136. Accs.push(`Email: ${acc.email} | pass: ${acc.pass}`);
  137. C++;
  138. delete acc.email;
  139. delete acc.pass;
  140. fs.writeFile("./nfa.json", JSON.stringify(nfa), (err) => {
  141. if (err) console.error(err)
  142. })
  143. });
  144. delete cools [message.author.id + message.guild.id];
  145. message.channel.send('**Done, Now Check Your DM**!')
  146. message.author.send(`Your Accs :)\`\`\`json\n${Accs.join("\n")}\n\`\`\`سيتم خذف الرساله بعد 5 دقائق !`).then(M => M.delete(5 * 60 * 1000))
  147. });
  148. }).catch(err => {
  149. delete cools [message.author.id + message.guild.id];
  150. })
  151. }
  152. }
  153.  
  154. if (message.content.startsWith(prefix + 'add')) {
  155.  
  156.  
  157. if (message.author.id !== URID) return message.reply("** Only <@" + URID + "> can use this command.**");
  158. let type = message.content.split(" ")[1];
  159. let email = message.content.split(" ")[2];
  160. let pass = message.content.split(" ")[3];
  161.  
  162. let types = ["sfa", "nfa", "send"]
  163.  
  164. if (!email) return message.reply("Email?");
  165. if (!pass) return message.reply("Password !")
  166. if (type == "sfa") {
  167. let alt = {
  168. "email": `${email}`,
  169. "pass": `${pass}`
  170. }
  171. sfa.push(alt)
  172. fs.writeFile("./sfa.json", JSON.stringify(sfa), (err) => {
  173. if (err) console.error(err)
  174. })
  175.  
  176. message.reply("**Successfully adedd this account.**");
  177.  
  178.  
  179. } else if (type == "nfa") {
  180. let alt = {
  181. "email" : `${email}`,
  182. "pass" : `${pass}`
  183. }
  184. nfa.push(alt)
  185. fs.writeFile("./nfa.json", JSON.stringify(nfa), (err) => {
  186. if (err) console.error(err)
  187. })
  188.  
  189. message.reply("**Successfully adedd this account.**");
  190.  
  191.  
  192. }
  193. }
  194. if (message.content.startsWith(prefix + 'give')) {
  195.  
  196. let type = message.content.split(" ")[2];
  197. let args = message.content.split(" ")[3];
  198. let user = message.mentions.users.first()
  199.  
  200. if (!user) return message.channel.send("**Please mention a user**")
  201.  
  202. if (!type) return message.channel.send("**Please input a alt type**")
  203. if (!args[0]) return message.reply("**Please input amount**")
  204. if (type === "sfa") {
  205. let C = 0;
  206. let Accs = [];
  207. sfa.forEach(acc => {
  208.  
  209. if (!acc.email) return;
  210. if (C == args) return;;
  211. Accs.push(`Email: ${acc.email} | pass: ${acc.pass}`);
  212. C++;
  213. delete acc.email;
  214. delete acc.pass;
  215.  
  216. fs.writeFile("./sfa.json", JSON.stringify(sfa), (err) => {
  217. if (err) console.error(err)
  218. })
  219. });
  220. message.channel.send('**Done**')
  221. user.send(`${message.author.username} has been gifted you a sfa account \n \`\`\`${Accs.join("\n")}\`\`\` `).then(M => M.delete(5 * 60 * 1000))
  222.  
  223. }
  224.  
  225. if (type === "nfa") {
  226. let C = 0;
  227. let Accs = [];
  228. nfa.forEach(acc => {
  229.  
  230. if (!acc.email) return;
  231. if (C == args) return;;
  232. Accs.push(`Email: ${acc.email} | pass: ${acc.pass}`);
  233. C++;
  234. delete acc.email;
  235. delete acc.pass;
  236.  
  237. fs.writeFile("./nfa.json", JSON.stringify(nfa), (err) => {
  238. if (err) console.error(err)
  239. })
  240. });
  241. message.channel.send('**Done**')
  242. user.send(`${message.author.username} has been gifted you a nfa account \n \`\`\`${Accs.join("\n")}\`\`\` `).then(M => M.delete(5 * 60 * 1000))
  243.  
  244. }
  245.  
  246. }
  247.  
  248. })
Advertisement
Add Comment
Please, Sign In to add comment