0% found this document useful (0 votes)
29 views23 pages

Message

Uploaded by

djokerz19900
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
0% found this document useful (0 votes)
29 views23 pages

Message

Uploaded by

djokerz19900
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1/ 23

const express = require("express");

const app = express();

app.listen(() => console.log("Server started"));

app.get("/", (req, res) => {


res.send("POWER")
})
//[0]
app.use('/ping', (req, res) => {
res.send(new Date());
});
const Discord = require("discord.js")
const dis = require("discord.js")
const { Client, Intents } = require('discord.js');

const client = new Client({ intents: [Intents.FLAGS.GUILDS,


Intents.FLAGS.GUILD_MESSAGES] });
const db = require("pro.db");

process.on('unhandledRejection', error => {


console.error('Unhandled promise rejection:', error);
});

// import setPrice from "./commands/setPrice"


let owners = '940301991224156190'//‫ايدي الي هيتحول‬
let owner;
const
updateAdmins = () => {
owner = db.get("admins")
owners = '940301991224156190'
owner.unshift('940301991224156190')//‫اي دي حقك‬
}
updateAdmins()
//let sv = '942205780839510086' ‫حط ايدي سيرفر يخرج منو بوت‬
let prefix = db.get("prefix") || "!"; ///‫برفكس‬
let embColor = "RED";
const approx = require('approximate-number');
client.on('messageCreate', async (message) => {
if (message.author.bot) return;
if (!message.guild || !message.content) return;
if (!message.content.startsWith(prefix)) return;
const args = message.content.split(' ');
const command = args.shift().slice(prefix.length);
if (command == 'sendTop') {
if (!message.member.permissions.has('ADMINISTRATOR')) return;
const users = Object.keys(db.fetchAll()).filter(a =>
a.startsWith('userdata_') && (db.get(a)?.mblg || 0) > 0).map(a => a.slice(9));
let topt;
if (users.length > 0) {
topt = users.sort((a, b) => db.get(`userdata_${b}`).mblg -
db.get(`userdata_${a}`).mblg).slice(0, 10).map((userId, index) => `- #${index + 1}
<@${userId}> ${approx(db.get(`userdata_${userId}`).mblg)}`).join('\n');
};
await message.delete();
let mmm = await message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setColor("YELLOW")

.setImage('https://cdn.discordapp.com/attachments/1214305685299400844/1214462751817
334794/1.jpg?
ex=65f93393&is=65e6be93&hm=7b611afb7a11865099618118b1e9c8887eb0329f025e924c9b83d741
4c3efac2&')
.setFooter({ text: `‫اجمالي عدد عمليات الشراء‬: ${db.get('shra2') ||
0}` })
.setTitle('‫)'قائمة المتصدرين العلى عمليات الشراء‬
.setDescription(
topt || 'empty'
)
],
});
db.set('topM', {
message: mmm.id,
channel: message.channel.id,
});
} else if (command == 'sendStock') {
if (!message.member.permissions.has('ADMINISTRATOR')) return;
const users = Object.keys(db.fetchAll()).filter(a =>
a.startsWith('userdata_') && (db.get(a)?.mblg || 0) > 0).map(a => a.slice(9));
let topt;
if (users.length > 0) {
topt = users.sort((a, b) => db.get(`userdata_${b}`).mblg -
db.get(`userdata_${a}`).mblg).slice(0, 10).map((userId, index) => `- #${index + 1}
<@${userId}> ${approx(db.get(`userdata_${userId}`).mblg)}`).join('\n');
};
await message.delete();
/*const embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle('‫*;)'المنتجات المتاحة‬/
const accounts = db.get('accounts') || [];
if (accounts.length == 0) return;
const topAs = (db.get('alls') || []).sort((a, b) => b.km - a.km);
const topa = topAs.length > 0 ? topAs[0] : null;
/*for (const account of accounts) {
embed.addFields({
name: `!buy ${account.name}`,
value: `${topa && topa.name == account.name ? '.‫ ' االكثر مبيعا‬: ''}‫السعر‬: $
{account.price}\n‫الكمية المتوفرة‬: ${account.emails.length}`,
});
};*/

const Embed = new Discord.MessageEmbed()


.setThumbnail(message.guild.iconURL({ dynamic: true }))
.setTitle('‫)'المنتجات المتاحة‬
.setColor('YELLOW')

const Embed2 = new Discord.MessageEmbed()


.setDescription(`<:poinet:1147308371398098964> ‫الرجاء تصوير مقطع فديو وانت تشري‬
‫نيترو وتدخله وتشيك شغال والال‬

<:line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:
line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:li
ne:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line
:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:1
147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:114
7310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:11473
10161044721717><:line:1147310161044721717>
<:poinet:1147308371398098964> ‫لو شريت وما صورت فديو ولقيت الرابط مستعمل ذا الشيء يمنعك من‬
‫الضمان ومارح تستلم التعويض‬

<:line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:
line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:li
ne:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line
:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:1
147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:114
7310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:11473
10161044721717><:line:1147310161044721717>
<:poinet:1147308371398098964> ‫انك ما قريت شو مكتوب ابدا مو عذر‬
<a:pp445:994681915623866480> `)
.setColor('YELLOW')

.setImage('https://media.discordapp.net/attachments/1170133698641932388/11998536337
48074566/uzmixiqzao.jpg?
ex=65c40dc6&is=65b198c6&hm=49a3aa6aa5a55201045a194a1e470f9c901f3eb560d6ea09a0afb8a1
a134924f&=&format=webp&width=705&height=201')

for (const account of accounts) {

Embed.addFields({
name: `<a:nitro3m:1199848781957566546> !buy ${account.name}`,
value: `${topa && topa.name == account.name ? '**‫االكثر مبيعا‬
<a:firre:1199848767877296220>** \n' : ''} **‫السعر‬:** ${account.price}
<a:credit:1144301622445494323> \n **‫الكمية المتوفرة‬:** ${account.emails.length}
<:stock:1199848786701328485>`,
});

let mmm = await message.channel.send({


embeds: [Embed, Embed2],
components: [
{
type: 1,
components: [{
type: 3,
custom_id: 'infomenu',
placeholder: '‫ | اخرى‬Other',
max_values: 1,
min_values: 1,
options: [{
label: '‫'احصائيات السيرفر‬,
value: 'a79',
}, {
label: '‫'معلومات عن البوت‬,
value: 'botinfo',
}],
}]
}
]
});
db.set('stockM', {
message: mmm.id,
channel: message.channel.id,
});
};
});
client.on('interactionCreate', async i => {
if (!i.customId) return;
if (i.customId == 'infomenu') {
if (i.values[0] == 'a79') {
await i.reply({
embeds: [
new Discord.MessageEmbed()
.setColor('YELLOW')
.setThumbnail(i.guild.iconURL())
.setDescription(`‫عدد العمالء‬: ${db.get('3mla2')?.length || 0}\n
‫عدد عمليات الشراء‬: ${db.get('shra2') || 0}`)
],
ephemeral: true,
});
} else {
await i.reply({
embeds: [
new Discord.MessageEmbed()
.setColor('YELLOW')
.setThumbnail(i.guild.iconURL())
.setDescription(`**‫سرعة االستجابة‬: ${client.ws.ping}**\n ‫مدة تشغيل‬
‫البوت‬: \`${Math.floor(client.uptime / (1000 * 60 * 60 * 24))}\` ‫`\ يوم و‬$
{Math.floor(client.uptime / (1000 * 60 * 60)) % 24}\` ‫`\ ساعة و‬$
{Math.floor(client.uptime / (1000 * 60)) % 60}\` ‫`\ دقيقة و‬${Math.floor(client.uptime
/ (1000)) % 60}\` ‫ثانية‬.`)
],
ephemeral: true,
});
};
} else if (i.customId == "hoebm") {
await i.reply({
ephemeral: true,
content: `**‫** طريقة الشراء مثل ما هو موضح في شرح‬

!buy nitro3m`,
files:
["https://cdn.discordapp.com/attachments/1182393554031628400/1204768911074000896/20
24-02-07_12-58-28_2.gif?
ex=65d5ef7b&is=65c37a7b&hm=d0e8accce8d9d1e05f654e1f6d1999b9862047f8f4ad04e11a57a07d
dcef88b6&"],
});
};
});
client.on('ready', async () => {
setInterval(async () => {
const stock = db.get('stockM');
if (stock) {
try {
const channel = client.channels.cache.get(stock.channel);
if (!channel) return;
const message = await channel.messages.fetch(stock.message);
if (!message) return;
/*const embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle('‫*;)'المنتجات المتاحة‬/

const accounts = db.get('accounts') || [];


if (accounts.length == 0) return;
const topAs = (db.get('alls') || []).sort((a, b) => b.km - a.km);
const topa = topAs.length > 0 ? topAs[0] : null;

const Embed = new Discord.MessageEmbed()


.setThumbnail(message.guild.iconURL({ dynamic: true }))
.setTitle('‫)'المنتجات المتاحة‬
.setColor('YELLOW')

const Embed2 = new Discord.MessageEmbed()


.setDescription(`<:poinet:1147308371398098964> ‫الرجاء تصوير مقطع فديو‬
‫وانت تشري نيترو وتدخله وتشيك شغال والال‬

<:line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:
line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:li
ne:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line
:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:1
147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:114
7310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:11473
10161044721717><:line:1147310161044721717>
<:poinet:1147308371398098964> ‫لو شريت وما صورت فديو ولقيت الرابط مستعمل ذا الشيء يمنعك من‬
‫الضمان ومارح تستلم التعويض‬

<:line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:
line:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:li
ne:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line
:1147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:1
147310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:114
7310161044721717><:line:1147310161044721717><:line:1147310161044721717><:line:11473
10161044721717><:line:1147310161044721717>
<:poinet:1147308371398098964> ‫انك ما قريت شو مكتوب ابدا مو عذر‬
<a:pp445:994681915623866480> `)
.setColor('YELLOW')

.setImage('https://media.discordapp.net/attachments/1170133698641932388/11998536337
48074566/uzmixiqzao.jpg?
ex=65c40dc6&is=65b198c6&hm=49a3aa6aa5a55201045a194a1e470f9c901f3eb560d6ea09a0afb8a1
a134924f&=&format=webp&width=705&height=201')

for (const account of accounts) {

Embed.addFields({
name: `<a:nitro3m:1199848781957566546> !buy $
{account.name}`,
value: `${topa && topa.name == account.name ? '**‫االكثر مبيعا‬
<a:firre:1199848767877296220>** \n' : ''} **‫السعر‬:** ${account.price}
<a:credit:1144301622445494323> \n **‫الكمية المتوفرة‬:** ${account.emails.length}
<:stock:1199848786701328485>`,
});
};

/*for (const account of accounts) {


embed.addFields({
name: `!buy ${account.name}`,
value: `${topa && topa.name == account.name ? '‫ 'االكثر مبيعا‬: ''}
‫السعر‬: ${account.price}\n‫الكمية المتوفرة‬: ${account.emails.length}`,
});
};*/

await message.edit({
embeds: [Embed, Embed2],
});
} catch { };
};
}, 30000);
setInterval(async () => {
const top = db.get('topM');
if (top) {
try {
const channel = client.channels.cache.get(top.channel);
if (!channel) return;
const message = await channel.messages.fetch(top.message);
if (!message) return;
const users = Object.keys(db.fetchAll()).filter(a =>
a.startsWith('userdata_') && (db.get(a)?.mblg || 0) > 0).map(a => a.slice(9));
let topt;
if (users.length > 0) {
topt = users.sort((a, b) => db.get(`userdata_${b}`).mblg -
db.get(`userdata_${a}`).mblg).slice(0, 10).map((userId, index) => `- #${index + 1}
<@${userId}> ${approx(db.get(`userdata_${userId}`).mblg)}`).join('\n');
};
if (!topt) return;
await message.edit({
embeds: [
new Discord.MessageEmbed()
.setColor("YELLOW")

.setImage('https://cdn.discordapp.com/attachments/1214305685299400844/1214462751817
334794/1.jpg?
ex=65f93393&is=65e6be93&hm=7b611afb7a11865099618118b1e9c8887eb0329f025e924c9b83d741
4c3efac2&')
.setFooter({ text: `‫اجمالي عدد عمليات الشراء‬: ${db.get('shra2')
|| 0}` })
.setTitle('‫)'قائمة المتصدرين العلى عمليات الشراء‬
.setDescription(
topt || 'empty'
)
],
});
} catch { };
};
}, 30000);
});
client.on("ready", () => {
/* client.guilds.cache.forEach(g => {
if (g.id !== sv) g.leave()
})
client.on('guildCreate', guild => {
if (guild.id !== sv) return guild.leave()
})*/

console.log(`Logged in as ${client.user.tag}!`);
// Set the client user's presence
let textList = ["BY bm.a", `${prefix}help`, "Rolbox Premium Shop", "BMA DADY"]
client.user.setPresence({ activities: [{ name: `${prefix}help` }], status:
'online' })

setInterval(() => {
let text = textList[Math.floor(Math.random() * textList.length)]
client.user.setPresence({ activities: [{ name: text }], status: 'online' })
}, 30000)
})

const logToCh = (channel, message, payload, account, verb) => {


if (db.has(channel)) {
ch = db.get(channel)
client.channels.cache
.get(ch)

.send({
embeds: [new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.setTimestamp()
.setDescription(`${message.author.tag} ${verb} ${account} :\n \
`\`\`${payload.join("\n")}\`\`\``)

.setColor(embColor)
]
})
}
}

const shopLog = new Discord.WebhookClient({ url:


'https://discordapp.com/api/webhooks/1226123760298491936/mFfco1ah-
jQ4ew3KqbXKMVsI1dnRPKPpbo4vzWaQHDW0TroBOmqERrgzpHgYd0Ih7EMj' });

client.on("message", async message => {


let prefixx = "s";
const args = message.content
.slice(prefixx.length)
.trim()
.split(/ +/);
const command = args.shift().toLowerCase();
if (message.content.startsWith(prefix + "etprefix")) {
if (!owner.includes(message.author.id)) return;
if (!args[0])
return message.channel.send(
db.get("prefix") || `> **The Server Prefix is : \`${prefix}\``
);
db.set("prefix", args[0]);
message.channel.send(
`> **Done Setting the new Prefix To : \`${db.get("prefix")}\``
);
}
});

let cooldown = false;


client.on("message", async message => {
try {
if (db.get("blacklist").includes(message.author.id)) return;
const args = message.content.slice(prefix.length).trim().split(/ +/);

const command = args.shift().toLowerCase();


if (!message.content.startsWith(prefix) || message.author.bot) return;

if (command === "status") {


if (!owner.includes(message.author.id)) return;
if (!args[0]) return message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.addField(
`> Error :`,
`Usage : ${prefix}status \`TYPE\`\n\n \`\`\`TYPE =
[ open : to open the shop \n close : to close the shop ]\`\`\``
)

.setColor(embColor)
.setTimestamp()
.setTitle("Status Command")
.setColor(embColor)]
}
);
if (args[0] === "open") {
message.channel.send("> ** Store opened successfully ✅**");
db.set("status", args[0]);
}
if (args[0] === "close") {
db.delete("status");
message.channel.send("> ** Store closed successfully ✅**");
}
}

if (command.startsWith("setprice-")) {

const account = command.split("-")[1]

if (!owner.includes(message.author.id)) return
message.channel.send("You don't have permission ❌");
if (message.channel.type === "dm") return;
let tax = Math.floor(args[0] * (20 / 19) + 1);
if (!tax)
return message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.addField(
`> Error :`,
`Usage : ${prefix}setprice-${account} \`PRICE\`\n\n
\`\`\`PRICE = [ Enter account price ]\`\`\``
)

.setColor(embColor)
.setTimestamp()
.setTitle(`Setprice ${account} Command`)]
}
).setColor(embColor);

let data = db.get("accounts")


let thisAcc = data.find(el => el.name === account)

if (!thisAcc) return message.channel.send("**There is no such account


❌**")
data[data.indexOf(thisAcc)].price = Number(args[0])
data[data.indexOf(thisAcc)].tax = tax

db.set("accounts", data)

return message.channel.send(`> ** The price of ${account} accounts has


been successfully determined ✅**`);
}

if (command.startsWith("add-")) {

const account = command.split("-")[1]

if (!owner.includes(message.author.id)) return;
if (!args[0])
return message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.addField(
`> Error :`,
`Usage : ${prefix}add-${account} \`ACCOUNT\`\n\n \
`\`\`ACCOUNT = [ EMAIL:PASSWORD ]\`\`\``
)
.setColor(embColor)
.setTimestamp()
.setTitle(`Add ${account} Accounts Command`)]
}
);
if (!message.content.includes(":"))
return message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.addField(
`> Error :`,
`Usage : ${prefix}add-${account} \`ACCOUNT\`\n\n \
`\`\`ACCOUNT = [ EMAIL:PASSWORD ]\`\`\``
)

.setColor(embColor)
.setTimestamp()
.setTitle(`Add ${account} Accounts Command`)]
}
);

let Data = db.get("accounts")


let thisAcc = Data.find(el => el.name === account)

if (!thisAcc) {
let m = message.content.split(" ").slice(1).join(" ").split("\n")
Data.push({ name: account, price: 0, tax: 0, emails: m })
db.set("accounts", Data)
message.delete()
return message.channel.send(`> ** The ${account} account has been
added successfully ✅**`);
}
else {
let m = message.content.split(" ").slice(1).join(" ").split("\n")

currentData = Data[Data.indexOf(thisAcc)].emails
Data[Data.indexOf(thisAcc)].emails = [...currentData, ...m]
db.set("accounts", Data)
logToCh("add", message, m, account, "added")
message.delete()
return message.channel.send(`> **The ${account} account has been
added successfully ✅**`);
}

if (command.startsWith("delete-")) {
const account = command.split("-")[1]
if (!owner.includes(message.author.id)) return;
let data = db.get("accounts")
let newData = data.filter(el => el.name !== account)

db.set("accounts", newData);
message.channel.send(`> ** ${account} category has been deleted
successfully ✅**`);
}

if (command.startsWith("give-")) {
if (!owner.includes(message.author.id)) return
message.channel.send("**only admins can use give gommand**")
let user =
message.mentions.users.first() ||
message.guild.members.cache.find(u => u.id === args[0]);

const numOfAcc = args[1] || 1


const account = command.split("-")[1]
const data = db.get("accounts")
let accInDb = data.find(el => el.name === account)
if (!accInDb) { return message.channel.send("**This item does not exist
❌**") }
if (!user)
return message.channel.send("> **Please select the user correctly
**");
if (accInDb.emails.length < numOfAcc) { return
message.channel.send("**Not enough accounts in stock, please check the bot at a
later time**") }

const sentMail = accInDb.emails.splice(0, numOfAcc)


logAcc = sentMail;
data[data.indexOf(accInDb)].emails = accInDb.emails;
db.set("accounts", data)
user.send(`**${message.author.username}** ${client.user.username} gave
you ${numOfAcc} ${account} account${numOfAcc > 1 ? "s" : ""}:\n\nYour account$
{numOfAcc > 1 ? "s" : ""}:\n${sentMail.join("\n")}`)
.then(() => {
// Handle success if needed
})
.catch(error => {
console.error(`Error sending message to user: ${error}`);
// Handle error if needed
});

message.channel.send(`<@${user.id}> **‫)`**✅ شيك خاصك‬

if (db.has("ch")) {
ch = db.get("ch")
client.channels.cache
.get(ch)
.send({
embeds: [new Discord.MessageEmbed().setTitle(`$
{message.author.tag} gave ${numOfAcc} ${account} account to ${user.username}`)
.setDescription(`\`\`\`${logAcc.join("\n")}\`\`\``)
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.setTimestamp()

.setColor(embColor)

]
});
}

if (command === "buy") {


const buyId = db.get("buy")
if (![message.channel.id, "all"].includes(buyId)) {
message.reply("**‫;)"**❌ ذا مش ايدي الروم يا حب‬
return;
}
if (cooldown === true) return message.reply("**‫ " **إنتظر دقيقه للشراء مره اخرى‬+
"<@" + message.author.id + ">");
const account = args[0], numOfAcc = args[1] || 1

const data = db.get("accounts")


let accInDb = data.find(el => el.name === account)
if (!accInDb) { return message.channel.send("**This item does not exist
❌**") }
let { price, tax, emails } = accInDb;
let probotid = db.get("probot") || "1000167861857288312";
let role = db.get("role");
if (message.channel.type === "dm") return;
if (!db.has("status")) return message.channel.send("The store is
closed.");

if (emails.length < numOfAcc) { return message.channel.send("** ‫خلصت‬


‫} )"**الستوكات حاليا تعال بعدين‬
let logAcc;

/* let buys = new Discord.MessageEmbed()


.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.setTimestamp()
.addField(`**Purchasing ${account} account :**`
,
`

> **-‫ عدد الستوك‬:** \`${numOfAcc}\`


> **-‫ السعر الكامل‬:** \`${tax * numOfAcc}\`
> **‫ ثانية فقط‬50 ‫**معك مهله دفع‬
> **‫**ضروري تتاكد خاصك مفتوح‬⚠️

**‫ للشراء اكتب االمر‬:**


\`\`\`
#credit <@${owners}> ${numOfAcc * tax}
\`\`\`
` )

.setColor(embColor);*/

const buyEmbed = new Discord.MessageEmbed()


.setAuthor({ name: message.author.username, iconURL:
message.author.displayAvatarURL({ dynamic: true }) })
.setFooter({ text: message.guild.name, iconURL:
message.guild.iconURL({ dynamic: true }) })

.setThumbnail('https://media.discordapp.net/attachments/1160233315991830558/1199865
434304942090/buy.png?
ex=65c418c3&is=65b1a3c3&hm=905b6a07e05cc250afc1a04a23149d142e54b3950971aa430b4b16cf
fb910af4&=&format=webp&quality=lossless&width=409&height=409')
.setTimestamp()
.setColor(embColor)
.setDescription(`
> **‫ لشراء‬, **‫** مرحبًا‬${account}** ‫يرجي اتباع الخطوات التالية‬

1️⃣ **‫**ال تقم بأغالق خاصك مطلقًا‬


2️⃣ **‫**اذا واجهتك أي مشكلة قم بطلب الدعم الفني‬
3️⃣ **‫ دقيقة للتحويل‬1 ‫**لديك‬
4️⃣ **‫ وقم بتحويل‬${tax * numOfAcc} ‫@< كريدت لـ‬${owners}> 🔸**

**‫ نوع المنتج‬: \`${account}\`**


**‫ العدد‬: \`${numOfAcc}\`**
**‫ السعر الكلي‬: \`${tax * numOfAcc}\`**
・・・・・・・・・・・・・・・・・・・・・
‫⬇ الرجاء كتابة هذا‬
\`\`\`c ${owners} ${numOfAcc * tax}\`\`\``)

message.channel.send({
embeds: [buyEmbed], components: [{
type: 1,
components: [new
dis.MessageButton().setStyle('SUCCESS').setCustomId('hoebm').setLabel("‫])"طريقة الشراء‬,
}
]
}).then(msg => {

const filter = ({ content, author: { id } }) => {

return content.startsWith(
`**:moneybag: | ${message.author.username}, has transferred
`
) &&
content.includes(`${owners}`) &&
id === probotid &&
(Number(content.slice(content.lastIndexOf("`") - String(tax
* numOfAcc).length, content.lastIndexOf("`"))) >= price * numOfAcc)
}

message.channel.awaitMessages({
filter,
max: 1,
time: 50_000,
errors: ['time']
}).then(msg => {
const sentMail = emails.splice(0, numOfAcc)
logAcc = sentMail;
data[data.indexOf(accInDb)].emails = emails;
db.set("accounts", data)

message.author.send({ content: `${sentMail.join("\n")}` })

//message.reply("**‫)"**✅ شيك خاصك‬

let embed = new Discord.MessageEmbed()


.setTitle(" <:payed:1214456695112204348> ‫تمت عملية الشراء بنجاح ال‬
985825437466906675#< ‫)">تنسى‬
.setColor('RED')
message.channel.send({ embeds: [embed] });
shopLog.send({
username: message.author.username,
avatarURL: message.author.displayAvatarURL(),
content: `${message.author.tag} ‫ اشترى‬${account} ‫شكرا لشرائك من‬
‫`متجرنا‬,
}).catch(() => 0);
let mm = db.get('3mla2') || [];
if (!mm.includes(message.author.id)) {
mm.push(message.author.id);
db.set('3mla2', mm);
};
let i;
let alls = db.get('alls') || [];
const accData = alls.find((a, index) => {
let stt = a.name == account;
if (stt) {
i = index;
};
return stt;
}) || {
km: 0,
name: account,
};
accData.km += Number(numOfAcc);
if (i) {
alls[i] = accData;
} else {
alls.push(accData);
};
db.set('alls', alls);
db.set('shra2', (db.get('shra2') || 0) + Number(numOfAcc));
let userData = db.get(`userdata_${message.author.id}`) || {
mblg: 0,
number: 0,
};
userData.mblg += (price * Number(numOfAcc));
userData.number += Number(numOfAcc);
db.set(`userdata_${message.author.id}`, userData);
msg.delete()

})

.then(() => {
cooldown = false
if (db.has("ch")) {
ch = db.get("ch")
if (ch) {
client.channels.cache
.get(ch)

//mm

// .send(`${message.author.tag} bought a ${account}


account \n Account Informations : \`\`\`${logAcc.join("\n")}\`\`\``);
}
}
})

.catch(err => {
cooldown = false
console.log(err)
msg.delete()
message.reply("**‫)"** ❌ خلصت مهله الدفع وتم إلغاء الطلب‬
})

///////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
.then(() => {
cooldown = false
if (db.has("notif")) {
notif = db.get("notif")
if (notif) {
client.channels.cache
.get(notif)

//4
//1
// .send(`${message.author.tag} bought a ${account}
account \n Account Informations : \`\`\`${logAcc.join("\n")}\`\`\``);
}
}
})

.catch(err => {
cooldown = false
console.log(err)
msg.delete()
message.reply("**‫)"** ❌ خلصت مهله الدفع وتم إلغاء الطلب‬
})

})
!cooldown && (cooldown = true)

cooldown && setTimeout(() => {


// Removes the user from the set after a minute
cooldown = false

}, 60000);
return
}
if (command === "setlog") { //setlog
if (message.channel.type === "dm") return;
if (!owner.includes(message.author.id))
return;
let ch =
message.guild.channels.cache.find(ch =>
ch.name.toLocaleLowerCase().includes(args[0])
) || message.guild.channels.cache.find(ch => ch.id === args[0]);
if (!ch) return message.channel.send("> **Please select the room
correctly **");
db.set("ch", ch.id);
message.channel.send("> ** The log room has been selected successfully
✅**");
}
///////////////////////////////////////////////////////////////////////////
/////////////////////////////////
if (command === "setnotif") {
if (message.channel.type === "dm") return;
if (!owner.includes(message.author.id))
return;
let notif =
message.guild.channels.cache.find(notif =>
notif.name.toLocaleLowerCase().includes(args[0])
) || message.guild.channels.cache.find(notif => notif.id ===
args[0]);
if (!notif) return message.channel.send("> **Please select the room
correctly **");
db.set("notif", notif.id);
message.channel.send("> ** The notification room has been selected
successfully ✅**");
}
///////////////////////////////////////////////////////////////////////////
/////////////////////////////////
if (command === "reslog") {
if (message.channel.type === "dm") return;
if (!owner.includes(message.author.id))
return;
let ch =
message.guild.channels.cache.find(ch =>
ch.name.toLocaleLowerCase().includes(args[0])
) || message.guild.channels.cache.find(ch => ch.id === args[0]);
if (!ch) return message.channel.send("> **Please select the room
correctly **");
db.set("add", ch.id);
message.channel.send("> ** ‫;)"**✅ تم إختيار روم لوقات بنجاح‬
}
if (command === "user-add") {
if (message.channel.type === "dm") return;
if (owner[0] != message.author.id) return;
let user =
message.mentions.users.first() ||
message.guild.members.cache.find(u => u.id === args[0]);

if (!user)
return message.channel.send("> **Please select the user correctly
**");
db.push("admins", user.id);
updateAdmins()
message.channel.send(`> **${user.tag} Added as an admin ✅**`);
}
if (command === "ping") {
message.channel.send(
`🏓Latency is ${Date.now() -
message.createdTimestamp}ms. API Latency is ${Math.round(
client.ws.ping
)}ms`
);
}
if (command === "user-remove") {
if (message.channel.type === "dm") return;
if (owner[0] != message.author.id) return;
let user =
message.mentions.users.first() ||
message.guild.members.cache.find(u => u.id === args[0]);

if (!user)
return message.channel.send("> **Please select the user correctly
**");
const filtered = db.get("admins").filter(ad => ad != user.id)
db.set("admins", filtered);
updateAdmins()
message.channel.send(
`> ** ${user.tag} has been removed from the admin list ✅**`
);
}
if (command === "setprobot") {
if (!owner.includes(message.author.id)) return;
if (message.channel.type === "dm") return;
if (!args[0])
return message.channel.send("> **Please select the ID Probot
correctly **");
db.set("probot", args[0]);
message.channel.send("> **✅ ‫;)"**!تم إختيار ايدي بروبوت بنجاح‬
}
if (command === "setcustomerrole") {
let custommer =
message.guild.roles.cache.find(r =>
r.name.toLocaleLowerCase().includes(args[0])
) || message.guild.roles.cache.find(r => r.id === args[0]);
if (!custommer)
return message.channel.send("> **Please select the customer roll
correctly **");
db.set("role", custommer.id);
message.channel.send("> ** ‫;)"**✅ تم إختيار ايدي رول الكاستومر‬
}
if (command === "stock") {
if (message.channel.type === "dm") return;
const accounts = db.get("accounts")

/* let embed = new Discord.MessageEmbed()


.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)

.setTimestamp()
.setColor("RED");
for (let { name, price, tax, emails } of accounts) {

embed.addField(
`${name || "N/A"}`,
`
> **‫ السعر‬:** ${price}
> **‫ الستوكات‬:** ${emails.length}
> **‫للشراء‬:** \`${prefix}buy ${name}\`
`
)
}*/

const Embed = new Discord.MessageEmbed()


.setTitle('‫)'المنتجات المتاحة‬
.setThumbnail(message.guild.iconURL({ dynamic: true }))
.setColor('#FFFF00')

const topAs = (db.get('alls') || []).sort((a, b) => b.km - a.km);


const topa = topAs.length > 0 ? topAs[0] : null;

for (const account of accounts) {

Embed.addFields({
name: `<a:nitro3m:1199848781957566546> !buy ${account.name}`,
value: `${topa && topa.name == account.name ? '**‫االكثر مبيعا‬
<a:firre:1199848767877296220>** \n' : ''} **‫السعر‬:** ${account.price}
<a:credit:1144301622445494323> \n **‫الكمية المتوفرة‬:** ${account.emails.length}
<:stock:1199848786701328485>`,
});

message.channel.send({ embeds: [Embed] });

if (command === "setbuy") {


if (message.channel.type === "dm") return;
if (!owner.includes(message.author.id))
return;
let ch =
message.guild.channels.cache.find(ch =>
ch.name.toLocaleLowerCase().includes(args[0])
)?.id || message.guild.channels.cache.find(ch => ch.id ===
args[0])?.id;
args[0] === "all" && (ch = "all")
if (!ch) return message.channel.send("> **Please select the room
correctly **");
db.set("buy", ch);
message.channel.send("> ** ‫;)"**✅ تم إختيار الروم الشراء بنجاح‬

}
if (command.startsWith("remove-")) {
const acc = command.split("-")[1]

if (!owner.includes(message.author.id))
return;
if (message.channel.type === "dm") return;
if (!args[0])
return message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.addField(
`> Error :`,
`Usage : ${prefix}remove-${acc} \`ACCOUNT\`\n\n \`\
`\`ACCOUNT = [ EMAIL:PASSWORD ]\`\`\``
)

.setColor(embColor)
.setTimestamp()
.setTitle(`Remove ${acc} Account Command`)]
}
);
const data = db.get("accounts");
const account = data.find(el => el.name === acc)
if (!account)
return message.channel.send(`> **:x: There are no accounts in the
stock! **`);
if (args[0] === "all") {
data[data.indexOf(account)].emails.length = 0
db.set("accounts", data)

return message.channel.send(`> **All ${acc} accounts has been


removed successfully ✅**`);

}
else if (!message.content.includes(":"))
return message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setColor(embColor)
.setDescription(`> usage : ${prefix}remove${acc}
[adress:email]`)]
}
);
const filtered = account.emails.filter(accs => accs !== args[0]);
data[data.indexOf(account)].emails = filtered
db.set("accounts", data)
message.channel.send(`> **account \`${args[0]}\` has been removed
successfully ✅**`);
}

if (command.startsWith("display-")) {
const account = command.split("-")[1]

if (message.channel.type === "dm") return;

if (!owner.includes(message.author.id)) return;
const accounts = db.get("accounts")?.find(el => el?.name ===
account)?.emails;
const text =
accounts && accounts[0]
? accounts.join("\n")
: ` There are no ${account} accounts in your stock ❌`;
message.channel.send({
embeds: [
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.setTitle(`All ${account} accounts :`)
.setDescription(`\`\`\`${text}\`\`\``)
.setTimestamp().setColor(embColor)
]
}
);
}
if (command.startsWith("setcolor")) {
if (!owner.includes(message.author.id)) return
message.channel.send("**you are not an admin**")
embColor = args[0].toUpperCase();
message.channel.send(`**all embeds color was set to $
{args[0].toUpperCase()}**`)
}

if (command === "restart") {


if (!owner.includes(message.author.id)) return;
message.channel
.send(`Restart is in progress...`)
.then(() => client.destroy())
.then(() => {
client.login(process.env.token);
message.channel.send("> ** The bot has been successfully
restarted ✅**");
});
}
if (command === "help") {
if (message.channel.type === "dm") return;
const embed =
new Discord.MessageEmbed()
.setAuthor(
message.author.username,
message.author.displayAvatarURL({ dynamic: true })
)
.setTitle(`About ${client.user.username}`)
.addField(`General`, `\`stock => to see availabe stuff\`\n\`buy
[type] [number] => to buy anything\`\n\`ping => to see the latency\` `)
.setDescription(
`Developer : <@363087423829311488>`
)

.setColor(embColor)
if (owner.includes(message.author.id)) {
embed.addField(
`Administrator`,

`\n\n**👤 User**\n\n\`user-add [user] => add an administrator\`\


n\`user-remove [user] => remove an administrator\`\n\`blacklist [user] => add
someone to blacklist\`\n\`unblacklist => remove someone from blacklist\`\n\
`resetblacklist => clear blacklist\`\n
\**🛒 Shop\**\n
\`add-[type] [account] => add a new account\`\n\`remove-[type] [account] => remove
a specific account\`\n\`remove-[type] => remove all accounts\`\n\`setprice-[type]
=> change price\`\n\`delete-[type] => delete a full type\`\n\`give-[type] [user]
[number] => for replacement\`\n\`setbuy [all] or [channel_id] => select buy
channel\`\n
** Settings**\n
\`display-[type] => display all accounts\`\n\`setlog => set a log room\`\n\`status
[open] or [close]\`\n\`setcolor [color] => to change embeds color\``
)

}
message.channel.send({ embeds: [embed] });
}
}
catch (err) {
console.log(err.message)
}
});

client.on("message", async message => {


try {
if (db.get("blacklist").includes(message.author.id)) return;
let prefix = await db.get("prefix");
if (message.content.startsWith(prefix + "setname")) {
let args = message.content.split(" ");
let botnameee = args.slice(1).join(" ");
if (!owner.includes(message.author.id))
return message.channel.send(`** ❌ ‫;)`** فقط االونر يقدر يستعمل هل أمر‬
if (!botnameee)
return message.channel.send(
`** ❌ Please Provide me a name for the bot !**`
);
client.user.setUsername(`${botnameee}`);
message.channel.send(`Changing The bot's Name ...`).then(me => {
me.edit(` Done !`);
});
}
if (message.content.startsWith(prefix + "setavatar")) {
let args = message.content.split(" ");
let botnameee = args.slice(1).join(" ");
if (!owner.includes(message.author.id))
return message.channel.send(`** ❌ ‫;)`** فقط االونر يقدر يستعمل هل أمر‬
if (!botnameee)
return message.channel.send(
`** ❌ Please Provide me an avatar for the bot !**`
);
client.user.setAvatar(`${botnameee}`);
message.channel.send(`Changing The bot's Avatar ...`).then(me => {
me.edit(` Done !`);
});
}
}
catch (err) {
console.log(err.message)

}
});

client.on("message", async message => {


try {
if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content


.slice(prefix.length)
.trim()
.split(/ +/);
const command = args.shift().toLowerCase();
let user =
message.mentions.members.first() ||
client.users.cache.find(u => u.id === args[0]);
let blacklist = db.get("blacklist")
if (message.channel.type === "dm") return;
if (!db.get("admins").includes(message.author.id)) return;
if (command === "blacklist") {

if (!user)
return message.channel.send("> **Please select the user
correctly**");
if (blacklist.includes(user.id))
return message.channel.send("> **:x: The user is already in the
list!**");
db.push("blacklist", user.id)
message.channel.send("> **The user has been added to the blacklist
✅**");
}
if (command === "unblacklist") {

if (!user)
return message.channel.send("> **Please select the user
correctly**");
if (!blacklist.includes(user.id))
return message.channel.send("> **:x: The member is not in the list!
**");
const filtered = db.get("blacklist").filter(u => u != user.id)
db.set("blacklist", filtered);
message.channel.send("> **The user has been removed from the blacklist
✅**");
}
if (command === "resetblacklist") {

db.set("blacklist", []);
message.channel.send(
"> ** All members have been removed from the blacklist ✅**"
);
}
}
catch (err) {
console.log(err)
}
});

client.on("messageCreate", message => {


if (message.content == "-sendphoto" && message.author?.id ==
"363087423829311488") {
message.channel.send({ files:
["https://cdn.discordapp.com/attachments/1157453750819102840/1214457316850802688/36
3087423829311488.jpg?
ex=65f92e83&is=65e6b983&hm=aa4999995421c2e170f9e31c2ccfe43f8dad3492c929b7e728af5a4e
05c2c7e7&"] });
};
});

client.login("").catch((err) => {
console.log(err.message)
});

You might also like