Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Enmap = require("enmap");
- const vip = new Enmap({ name: "cbcbcbcbcb" });
- client.on("ready", () => {
- console.log("ready!");
- setInterval(function(){
- if (vip.get(client.user.id) === undefined) {
- vip.ensure(client.user.id, {
- end: null,
- still: ""
- })
- }
- },5)
- });
- const moment = require("moment");
- const ms = require("ms");
- client.on("ready", ()=>{
- if (vip.get(client.user.id) === undefined) {
- vip.ensure(client.user.id, {
- end: null,
- still: null,
- days: null
- })
- }
- if(vip.get(client.user.id, "end") == null) {
- vip.set(client.user.id, moment().add("1","month").format("ll h:mm:ss") , "end")
- }
- var countDownDate = new Date(`${vip.get(client.user.id, "end")}`).getTime();
- var x = setInterval(function() {
- var now = new Date().getTime();
- var distance = countDownDate - now;
- var days = Math.floor(distance / (1000 * 60 * 60 * 24));
- var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
- var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((distance % (1000 * 60)) / 1000);
- vip.set(client.user.id,days , "days")
- if(days == 5) {
- //حط الكود اللي يرسل للاونر
- }
- vip.set(client.user.id, days + " days " + hours + " hours " + minutes + " minutes " + seconds + " seconds.", "still");
- if (distance < 0) {
- clearInterval(x);
- //الكود اللي يطلعه من السيرفر
- vip.set(client.user.id, "EXPIRED", "still");
- }
- }, 1000);
- })
- var botp = 15000; //ثمن البوت
- client.on("message", message => {
- var prefix = protection.get(message.guild.id,"cprefix");
- if(message.author.bot || !message.channel.guild) return;
- if(message.content.startsWith(prefix+"renew")) {
- let mounth = ["month","m","months"];
- if(!mounth.includes(message.content.split(" ").splice(1).join(" ").replace(/\d+/g, ''))) return message.channel.send("It date should be in mounths");
- 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 =>{
- 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")});
- if(collected.first().content.startsWith("cancel")){
- msg.delete();
- message.reply("**تم الغاء عملية التجديد.**");
- }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>`)){
- msg.delete();
- message.reply("**لقد قمت بتجديد بوتك بنجاح **");
- vip.set(client.user.id, moment().add(ms(message.content.split(" ").splice(1)),"milliseconds").format("ll h:mm:ss") , "end")
- }
- })
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement