Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on("message", async OmegaCodes => {
- if(OmegaCodes.content.startsWith(`${prefix}rep`)){
- let user = OmegaCodes.guild.member(OmegaCodes.mentions.users.first() || false);
- if(!user) return OmegaCodes.channel.send(`**:rolling_eyes: | ${OmegaCodes.author.username}**, The user could not be found.`)
- if(user.id == OmegaCodes.author.id) return OmegaCodes.channel.send(`**:rolling_eyes: | ${OmegaCodes.author.username}, You cant give yourself a rep point !**`)
- if(user.bot) return OmegaCodes.channel.send(`**:thinking: | ${OmegaCodes.author.username} , bots do not have rep!**`)
- let timeout = 8.64e+7;
- let repotime = await db.fetch(`repotime_${OmegaCodes.author.id}`);
- if(repotime !== null && timeout - (Date.now() - repotime > 0 )) {
- let time = timeout - (Date.now() - repotime)
- OmegaCodes.channel.send(`** <@${OmegaCodes.author.id}> , \n An error occurred when attempting to perform that request. Please check the Syntax and try again.**
- __Error__: \`You can claim again after ${ms(time, {verbose: true})}\``)
- } else {
- OmegaCodes.channel.send(`** 🆙 | ${OmegaCodes.author.username} has given ${user} a reputation point!**`)
- await db.add(`rep_${user.id}`, 1);
- await db.set(`repotime_${OmegaCodes.author.id}`, Date.now());
- }
- }
- });
- client.on("message" , async OmegaCodes => {
- if(OmegaCodes.content.startsWith(`${prefix}daily`)){
- await db.add(`credits_${OmegaCodes.author.id}`,1)
- let amount = Math.floor(Math.random() * 4000) + 1;
- let timeout = 8.64e+7;
- if(OmegaCodes.author.bot) return OmegaCodes.channel.send(`**:thinking: | bots do not have credits!**`)
- let dailytime = await db.fetch(`dailytime_${OmegaCodes.author.id}`);
- if(dailytime !== null && timeout - (Date.now() - dailytime > 0 )) {
- let time = timeout - (Date.now() - dailytime)
- OmegaCodes.channel.send(`** <@${OmegaCodes.author.id}> , \n An error occurred when attempting to perform that request. Please check the Syntax and try again.**
- __Error__: \`You can claim again after ${ms(time, {verbose: true})}\``)
- } else {
- OmegaCodes.channel.send(`**💰 ${OmegaCodes.author.username} , You git 💵 ${amount} daily credits!**`)
- await db.add(`credits_${OmegaCodes.author.id}`,parseInt(amount))
- await db.set(`dailytime_${OmegaCodes.author.id}`, Date.now());
- }
- }
- });
- let captcha = require("./captcha.json");
- client.on("message" , async OmegaCodes => {
- await db.add(`credits_${OmegaCodes.author.id}`,1)
- if(OmegaCodes.content.startsWith(`${prefix}credits`)){
- let args = OmegaCodes.content.split(" ");
- if(!args[2]){
- let user = OmegaCodes.guild.member(OmegaCodes.mentions.users.first());
- if (user) {
- user = user.user
- } else {
- user = OmegaCodes.author
- }
- if(user.bot) return OmegaCodes.channel.send(`**:thinking: | ${OmegaCodes.author.username} , bots do not have credits!**`)
- let balance = await db.fetch(`credits_${user.id}`);
- if(balance === null) balance = 0;
- OmegaCodes.channel.send(`**:bank: | ${user.username} , your account balance is \`${balance}$\`**`)
- } else if(args[2]){
- let user = OmegaCodes.mentions.users.first();
- if(user.id === OmegaCodes.author.id) return OmegaCodes.channel.send(`**:rolling_eyes: | ${OmegaCodes.author.username}, You cant give yourself credits !**`)
- let balance = await db.fetch(`credits_${OmegaCodes.author.id}`);
- if(OmegaCodes.content.includes("-")) return OmegaCodes.channel.send("Negative money can not be transfer.")
- if (balance < parseInt(args[2]))
- return OmegaCodes.channel.send(`You don't have Enough credits to give to ${user.username}`)
- if(parseInt(args[2]) < 1)
- return OmegaCodes.channel.send(`You Must transfer credits above \`1\`.`)
- if(isNaN(parseInt(args[2])))
- return OmegaCodes.channel.send("Only Number")
- let tax = Math.floor(args[2] * (5 / 100));
- let Price = OmegaCodes.content.split(" ")[2];
- let resulting = Math.floor(Price - Price * (5 / 100));
- OmegaCodes.channel.send(`**${OmegaCodes.author.username}, Transfer Fees \`${tax}\`, Amount :\`${resulting}\` **\n type these numbers to confirm : `)
- .then(m => {
- const item = captcha[Math.floor(Math.random() * captcha.length)];
- const filter = response => {
- return item.answers.some(answer => answer.toLowerCase() === response.content.toLowerCase());
- };
- OmegaCodes.channel.send({
- files: [{
- attachment: item.type,
- name: "capatcha.png"
- }]
- }).then(s => {
- OmegaCodes.channel.awaitMessages(filter, { max: 1, time: 20000, errors: ['time'] })
- .then(async (collected) => {
- OmegaCodes.channel.send(
- `**:moneybag: - ${OmegaCodes.author.username}, has transferred \`$${resulting}\` to ${user}**`
- );
- user.send(
- `**:atm: | Transfer Receipt**\`\`\`You Have Received \$${resulting}\ From User ${OmegaCodes.author.username} (ID : ${OmegaCodes.author.id})\`\`\``
- );
- s.delete();
- m.delete();
- await db.add(`credits_${user.id}`, parseInt(resulting))
- await db.subtract(`credits_${OmegaCodes.author.id}`,parseInt(Price))
- })
- });
- });
- }
- }
- });
- //Captcha.json
- /*
- [
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692002715672379413/captcha.png",
- "answers": ["9340"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692002857704095785/captcha.png",
- "answers": ["2901"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692002944660275310/captcha.png",
- "answers": ["3735"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003101883891762/captcha.png",
- "answers": ["2414"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003169428832368/captcha.png",
- "answers": ["3517"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003259379875840/captcha.png",
- "answers": ["2643"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003356226617415/captcha.png",
- "answers": ["7175"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003638301687857/captcha.png",
- "answers": ["8705"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003735693426719/captcha.png",
- "answers": ["6281"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003816475852860/captcha.png",
- "answers": ["7331"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003894963863663/captcha.png",
- "answers": ["4062"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692003969207238656/captcha.png",
- "answers": ["8698"]
- },
- {
- "type": "https://cdn.discordapp.com/attachments/634854460102803456/692004078858797086/captcha.png",
- "answers": ["3865"]
- }
- ]
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement