Advertisement
Ayoub-toxic

vip

Jan 18th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Enmap = require("enmap");
  2. const vip = new Enmap({ name: "cbcbcbcbcb" });
  3. client.on("ready", () => {
  4.   console.log("ready!");
  5.   setInterval(function(){
  6.     if (vip.get(client.user.id) === undefined) {
  7.       vip.ensure(client.user.id, {
  8.        end: null,
  9.        still: ""
  10.       })
  11.     }
  12.   },5)
  13. });
  14. const moment = require("moment");
  15. const ms = require("ms");
  16. client.on("ready", ()=>{
  17.   if (vip.get(client.user.id) === undefined) {
  18.     vip.ensure(client.user.id, {
  19.      end: null,
  20.      still: null,
  21.      days: null
  22.     })
  23.   }
  24.   if(vip.get(client.user.id, "end") == null) {
  25.     vip.set(client.user.id, moment().add("1","month").format("ll h:mm:ss") , "end")
  26.   }
  27.   var countDownDate = new Date(`${vip.get(client.user.id, "end")}`).getTime();
  28.   var x = setInterval(function() {
  29.     var now = new Date().getTime();
  30.     var distance = countDownDate - now;
  31.     var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  32.     var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  33.     var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  34.     var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  35.     vip.set(client.user.id,days , "days")
  36.     if(days == 5) {
  37. //حط الكود اللي يرسل للاونر
  38.     }
  39.     vip.set(client.user.id, days + " days " + hours + " hours " + minutes + " minutes " + seconds + " seconds.", "still");
  40.     if (distance < 0) {
  41.       clearInterval(x);
  42. //الكود اللي يطلعه من السيرفر
  43.       vip.set(client.user.id, "EXPIRED", "still");
  44.     }
  45.   }, 1000);
  46. })
  47. var botp = 15000; //ثمن البوت
  48. client.on("message", message => {
  49.   var prefix = protection.get(message.guild.id,"cprefix");
  50.   if(message.author.bot || !message.channel.guild) return;
  51.   if(message.content.startsWith(prefix+"renew")) {
  52.     let mounth = ["month","m","months"];  
  53.     if(!mounth.includes(message.content.split(" ").splice(1).join(" ").replace(/\d+/g, ''))) return message.channel.send("It date should be in mounths");
  54.     message.channel.send(`**المرجوا تحويل المبلغ التالي لتجديد البوت : \`${Math.floor(message.content.split(" ").splice(1).join(" ").match(/\d+/)[0])*botp/1}\`\n\n\`#credits <@526444455746600960> ${Math.floor(message.content.split(" ").splice(1).join(" ").match(/\d+/)[0])*botp/1}\`**`).then(async msg =>{
  55.       let collected = await message.channel.awaitMessages(m => m.author.id =="567703512763334685" && m.content.includes(`:moneybag: | ${message.author.username}, has transferred \`$${Math.floor(5*(message.content.split(" ").splice(1).join(" ").match(/\d+/)[0]*botp/1))/1000}\` to <@526444455746600960>`) || m.author.id ==message.author.id && m.content.startsWith("cancel"), {max: 1, time: ms("5m")});
  56.       if(collected.first().content.startsWith("cancel")){
  57.         msg.delete();
  58.         message.reply("**تم الغاء عملية التجديد.**");
  59.       }else if(collected.first().content.includes(`:moneybag: | ${message.author.username}, has transferred \`$${Math.floor(5*(message.content.split(" ").splice(1).join(" ").match(/\d+/)[0]*botp/1))/1000}\` to <@512076288467664936>`)){
  60.         msg.delete();
  61.         message.reply("**لقد قمت بتجديد بوتك بنجاح **");
  62.         vip.set(client.user.id, moment().add(ms(message.content.split(" ").splice(1)),"milliseconds").format("ll h:mm:ss") , "end")
  63.       }
  64.     })
  65.   }
  66. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement