Dateien nach "commands/economy" hochladen
This commit is contained in:
parent
72aae26bc6
commit
96b5cf5e8e
|
@ -0,0 +1,44 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
|
||||
module.exports = {
|
||||
name: "balance",
|
||||
aliases: ["bal"],
|
||||
category: "economy",
|
||||
description: "Zeigt das aktuelle Guthaben an",
|
||||
usage: "[username | nickname | mention | ID](optional)",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let user =
|
||||
message.mentions.members.first() ||
|
||||
message.guild.members.cache.get(args[0]) ||
|
||||
message.guild.members.cache.find(
|
||||
r =>
|
||||
r.user.username.toLowerCase() === args.join(" ").toLocaleLowerCase()
|
||||
) ||
|
||||
message.guild.members.cache.find(
|
||||
r => r.displayName.toLowerCase() === args.join(" ").toLocaleLowerCase()
|
||||
) ||
|
||||
message.member;
|
||||
|
||||
let bal = db.fetch(`money_${user.id}`);
|
||||
|
||||
if (bal === null) bal = 0;
|
||||
|
||||
let bank = await db.fetch(`bank_${user.id}`);
|
||||
|
||||
if (bank === null) bank = 0;
|
||||
let Total = bal + bank
|
||||
if (user) {
|
||||
let moneyEmbed = new MessageEmbed()
|
||||
.setColor("BLUE")
|
||||
.setDescription(
|
||||
`**${user.user.username}'s Balance**\n**Cash:** ${bal}$\n**Bank:** ${bank}\n**Total:** ${Total}`
|
||||
);
|
||||
message.channel.send(moneyEmbed);
|
||||
} else {
|
||||
return message.channel.send("**Geben Sie einen gültigen Benutzer ein!**");
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,40 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
const ms = require("parse-ms");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "daily",
|
||||
aliases: ["coins-system"],
|
||||
category: "economy",
|
||||
description: "Gibt Ihnen 200 pro Tag",
|
||||
usage: " ",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let user = message.author;
|
||||
|
||||
let timeout = 86400000;
|
||||
let amount = 200;
|
||||
|
||||
let daily = await db.fetch(`daily_${user.id}`);
|
||||
|
||||
if (daily !== null && timeout - (Date.now() - daily) > 0) {
|
||||
let time = ms(timeout - (Date.now() - daily));
|
||||
|
||||
let timeEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie haben Ihre tägliche Belohnung bereits abgeholt\n\nSammeln Sie sie in ${time.hours}h ${time.minutes}m ${time.seconds}s erneut`);
|
||||
message.channel.send(timeEmbed)
|
||||
} else {
|
||||
let moneyEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben Ihre tägliche Prämie in Höhe von ${amount} Münzen gesammelt`);
|
||||
message.channel.send(moneyEmbed)
|
||||
db.add(`money_${user.id}`, amount)
|
||||
db.set(`daily_${user.id}`, Date.now())
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
const fishes = require('../../JSON/fishes.json');
|
||||
let db = require('quick.db');
|
||||
const ms = require("parse-ms");
|
||||
const { randomRange } = require('../../functions');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: 'fish',
|
||||
aliases: ['catchfish'],
|
||||
category: 'economy',
|
||||
description: 'Fangen Sie einen Fisch aus einem riesigen Ozean',
|
||||
usage: '[list | rewards] (optional)',
|
||||
acessableby: 'everyone'
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
|
||||
let user = message.author;
|
||||
|
||||
let bal = db.fetch(`money_${user.id}`)
|
||||
|
||||
let fish = await db.fetch(`fish_${user.id}`)
|
||||
if (!args[0]) {
|
||||
if (bal === null) bal = 0;
|
||||
|
||||
if (fish == null) fish = 0;
|
||||
|
||||
const fishID = Math.floor(Math.random() * 10) + 1;
|
||||
let rarity;
|
||||
if (fishID < 5) rarity = 'junk';
|
||||
else if (fishID < 8) rarity = 'common';
|
||||
else if (fishID < 9) rarity = 'uncommon';
|
||||
else if (fishID < 10) rarity = 'rare';
|
||||
else rarity = 'legendary';
|
||||
const fishh = fishes[rarity];
|
||||
const worth = randomRange(fishh.min, fishh.max);
|
||||
|
||||
let timeout = 1800000;
|
||||
let fishtime = await db.fetch(`fishtime_${user.id}`);
|
||||
|
||||
if (fishtime !== null && timeout - (Date.now() - fishtime) > 0) {
|
||||
let time = ms(timeout - (Date.now() - fishtime));
|
||||
|
||||
let timeEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast kürzlich eine Schnur ausgeworfen\n\nIn ${time.minutes}m ${time.seconds}s erneut gefischt`);
|
||||
return message.channel.send(timeEmbed)
|
||||
}
|
||||
|
||||
let embed = new MessageEmbed()
|
||||
.setColor('GREEN')
|
||||
.setDescription(`**🎣 Du wirfst deine Angel aus und fängst ein ${fishh.symbol}, ich wette, es würde ungefähr ${worth}** kosten!`)
|
||||
message.channel.send(embed);
|
||||
|
||||
db.add(`money_${user.id}`, worth);
|
||||
db.add(`fish_${user.id}`, 1);
|
||||
db.set(`fishtime_${user.id}`, Date.now())
|
||||
}
|
||||
if (args[0] === 'list' || args[0] === 'rewards') {
|
||||
|
||||
let lEmbed = new MessageEmbed()
|
||||
.setColor('GREEN')
|
||||
.setTitle(`Liste der Fischnamen und Belohnungen, die Sie erhalten können`)
|
||||
.setDescription(`
|
||||
\`\`\`🔧Junk :: Max. Belohnung: 5, Min. Belohnung: 1
|
||||
🐟Common :: Max. Belohnung: 25, Min. Belohnung: 10
|
||||
🐠Uncommon :: Max. Belohnung: 50, Min. Belohnung: 18
|
||||
🦑Rare :: Max. Belohnung: 75, Min. Belohnung: 30
|
||||
🐋Legendary :: Maximale Belohnung: 100, minimale Belohnung: 50\`\`\`
|
||||
**Alle Belohnungen sind zufällig von max/min**
|
||||
|
||||
`)
|
||||
.setFooter(message.guild.name, message.guild.iconURL())
|
||||
return message.channel.send(lEmbed);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "addmoney",
|
||||
aliases: ["am"],
|
||||
category: "economy",
|
||||
description: "Adds Money to a user",
|
||||
usage: "[ mention | ID]",
|
||||
accessableby: "Administrator, Owner"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("❌ Sie haben keine Berechtigung zum Hinzufügen von Geld! - [ADMINISTRATOR]");
|
||||
if (!args[0]) return message.channel.send("**Bitte geben Sie einen Benutzer ein!**")
|
||||
|
||||
let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args[0].toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args[0].toLocaleLowerCase());
|
||||
if (!user) return message.channel.send("**Geben Sie einen gültigen Benutzer ein!**")
|
||||
if (!args[1]) return message.channel.send("**Bitte geben Sie einen Betrag ein!**")
|
||||
if (isNaN(args[1])) return message.channel.send(`**❌ Ihr Betrag ist keine Zahl!**`);
|
||||
if (args[0] > 10000) return message.channel.send("**So viel Betrag kann nicht hinzugefügt werden!**")
|
||||
db.add(`money_${user.id}`, args[1])
|
||||
let bal = db.fetch(`money_${user.id}`)
|
||||
|
||||
let moneyEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Added ${args[1]} coins\n\nNew Balance: ${bal}`);
|
||||
message.channel.send(moneyEmbed)
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
const ms = require("parse-ms");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "beg",
|
||||
noalias: [""],
|
||||
category: "economy",
|
||||
description: "Beg for money",
|
||||
usage: " ",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let user = message.author;
|
||||
|
||||
let timeout = 120000;
|
||||
let amount = 20;
|
||||
|
||||
let beg = await db.fetch(`beg_${user.id}`);
|
||||
|
||||
if (beg !== null && timeout - (Date.now() - beg) > 0) {
|
||||
let time = ms(timeout - (Date.now() - beg));
|
||||
|
||||
let timeEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast vor kurzem schon gebettelt, Bettel in ${time.minutes}m ${time.seconds}s erneut`);
|
||||
message.channel.send(timeEmbed)
|
||||
} else {
|
||||
let moneyEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben ${amount} Coins erbettelt und erhalten`);
|
||||
message.channel.send(moneyEmbed)
|
||||
db.add(`money_${user.id}`, amount)
|
||||
db.add(`begs_${user.id}`, 1)
|
||||
db.set(`beg_${user.id}`, Date.now())
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,102 @@
|
|||
const { MessageEmbed } = require('discord.js')
|
||||
const db = require('quick.db')
|
||||
const { default_prefix } = require('../../config');
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "buy",
|
||||
noalias: [""],
|
||||
category: "economy",
|
||||
description: "kauft Artikel",
|
||||
usage: "[item]",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let user = message.author;
|
||||
|
||||
let prefix;
|
||||
let fetched = await db.fetch(`prefix_${message.guild.id}`);
|
||||
|
||||
if (fetched === null) {
|
||||
prefix = default_prefix
|
||||
} else {
|
||||
prefix = fetched
|
||||
}
|
||||
|
||||
let author = db.fetch(`money_${user.id}`)
|
||||
|
||||
let Embed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie benötigen 200 Münzen, um Bronze VIP zu kaufen`);
|
||||
|
||||
|
||||
if (args.join(' ').toLocaleLowerCase() == 'bronze') {
|
||||
if (author < 200) return message.channel.send(Embed)
|
||||
|
||||
await db.fetch(`bronze_${user.id}`);
|
||||
db.set(`bronze_${user.id}`, true)
|
||||
|
||||
let Embed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Bronze-VIP für 200 Münzen gekauft`);
|
||||
|
||||
db.subtract(`money_${user.id}`, 200)
|
||||
message.channel.send(Embed2)
|
||||
} else if (args.join(' ').toLocaleLowerCase() == 'nikes') {
|
||||
let Embed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie benötigen 600 Münzen, um einige Nikes zu kaufen`);
|
||||
|
||||
if (author < 600) return message.channel.send(Embed3)
|
||||
|
||||
await db.fetch(`nikes_${user.id}`)
|
||||
db.add(`nikes_${user.id}`, 1)
|
||||
|
||||
let Embed4 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Frische Nikes für 600 Münzen gekauft`);
|
||||
|
||||
db.subtract(`money_${user.id}`, 600)
|
||||
message.channel.send(Embed4)
|
||||
} else if (args.join(' ').toLocaleLowerCase() == 'car') {
|
||||
let Embed5 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie benötigen 800 Münzen, um ein neues Auto zu kaufen`);
|
||||
|
||||
if (author < 800) return message.channel.send(Embed5)
|
||||
|
||||
await db.fetch(`car_${user.id}`)
|
||||
db.add(`car_${user.id}`, 1)
|
||||
|
||||
let Embed6 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Ein neues Auto für 800 Münzen gekauft`);
|
||||
|
||||
db.subtract(`money_${message.guild.id}_${user.id}`, 800)
|
||||
message.channel.send(Embed6)
|
||||
} else if (args.join(' ').toLocaleLowerCase() == 'mansion') {
|
||||
let Embed7 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie benötigen 1200 Münzen, um eine Villa zu kaufen`);
|
||||
|
||||
if (author < 1200) return message.channel.send(Embed7)
|
||||
|
||||
await db.fetch(`house_${user.id}`)
|
||||
db.add(`house_${user.id}`, 1)
|
||||
|
||||
let Embed8 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Eine Villa für 1200 Münzen gekauft`);
|
||||
|
||||
db.subtract(`money_${user.id}`, 1200)
|
||||
message.channel.send(Embed8)
|
||||
} else {
|
||||
if (message.content.toLowerCase() === `${prefix}buy`) {
|
||||
let embed9 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen zu kaufenden Artikel ein!\n Geben Sie ${prefix}shop ein, um die Artikelliste anzuzeigen!`)
|
||||
return message.channel.send(embed9)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "deposit",
|
||||
aliases: ["dep"],
|
||||
category: "economy",
|
||||
description: "Deposits money to bank",
|
||||
usage: "<amount>",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
|
||||
let user = message.author;
|
||||
|
||||
let member = db.fetch(`money_${user.id}`)
|
||||
|
||||
if (args[0] == 'all') {
|
||||
let money = await db.fetch(`money_${user.id}`)
|
||||
|
||||
let embedbank = new MessageEmbed()
|
||||
.setColor('GREEN')
|
||||
.setDescription("❌ Sie haben kein Geld zum Einzahlen")
|
||||
|
||||
if (!money) return message.channel.send(embedbank)
|
||||
|
||||
db.subtract(`money_${user.id}`, money)
|
||||
db.add(`bank_${user.id}`, money)
|
||||
let sembed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben alle Ihre Coins in Ihre Bank eingezahlt`);
|
||||
message.channel.send(sembed)
|
||||
|
||||
} else {
|
||||
|
||||
let embed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen Einzahlungsbetrag an`);
|
||||
|
||||
if (!args[0]) {
|
||||
return message.channel.send(embed2)
|
||||
.catch(err => message.channel.send(err.message))
|
||||
}
|
||||
let embed6 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Ihr Betrag ist keine Zahl!`)
|
||||
|
||||
if(isNaN(args[0])) {
|
||||
return message.channel.send(embed6)
|
||||
|
||||
}
|
||||
let embed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie können kein negatives Geld einzahlen`);
|
||||
|
||||
if (message.content.includes('-')) {
|
||||
return message.channel.send(embed3)
|
||||
}
|
||||
let embed4 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast nicht so viel Geld`);
|
||||
|
||||
if (member < args[0]) {
|
||||
return message.channel.send(embed4)
|
||||
}
|
||||
|
||||
let embed5 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben ${args[0]}-Coins auf Ihre Bank eingezahlt`);
|
||||
|
||||
message.channel.send(embed5)
|
||||
db.subtract(`money_${user.id}`, args[0])
|
||||
db.add(`bank_${user.id}`, args[0])
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
const { MessageEmbed } = require('discord.js');
|
||||
const db = require('quick.db');
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "leaderboard",
|
||||
aliases: ['lb'],
|
||||
category: 'economy',
|
||||
description: 'Zeigt Servers Top 10 Benutzer der Economy-Bestenliste',
|
||||
usage: ' ',
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let money = db.all().filter(data => data.ID.startsWith(`money_`)).sort((a, b) => b.data - a.data);
|
||||
if (!money.length) {
|
||||
let noEmbed = new MessageEmbed()
|
||||
.setAuthor(message.member.displayName, message.author.displayAvatarURL())
|
||||
.setColor("GREEN")
|
||||
.setFooter("Hier gibt es noch nichts zu sehen!")
|
||||
return message.channel.send(noEmbed)
|
||||
};
|
||||
|
||||
money.length = 10;
|
||||
var finalLb = "";
|
||||
for (var i in money) {
|
||||
if (money[i].data === null) money[i].data = 0
|
||||
finalLb += `**${money.indexOf(money[i]) + 1}. ${bot.users.cache.get(money[i].ID.split('_')[1]) ? bot.users.cache.get(money[i].ID.split('_')[1]).tag : "Unbekannter Benutzer#0000"}** - ${money[i].data} :euro:\n`;
|
||||
};
|
||||
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`Leaderboard Of ${message.guild.name}`)
|
||||
.setColor("GREEN")
|
||||
.setDescription(finalLb)
|
||||
.setFooter(bot.user.tag, bot.user.displayAvatarURL())
|
||||
.setTimestamp()
|
||||
message.channel.send(embed);
|
||||
}
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "pay",
|
||||
noalias: [""],
|
||||
category: "economy",
|
||||
description: "An jemanden zahlen",
|
||||
usage: "[mention | ID] <amount>",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
try {
|
||||
let user2 = message.author
|
||||
if (!args[0]) return message.channel.send("**Bitte geben Sie einen Benutzer ein!**");
|
||||
let user =
|
||||
message.mentions.members.first() ||
|
||||
message.guild.members.cache.get(args[0]) ||
|
||||
message.guild.members.cache.find(
|
||||
r => r.user.username.toLowerCase() === args[0].toLocaleLowerCase()
|
||||
) ||
|
||||
message.guild.members.cache.find(
|
||||
r => r.displayName.toLowerCase() === args[0].toLocaleLowerCase()
|
||||
);
|
||||
if (!user) return message.channel.send("**Geben Sie einen gültigen Benutzer ein!**");
|
||||
|
||||
let member = db.fetch(`money_${user2.id}`);
|
||||
|
||||
let embed1 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Erwähnen Sie jemanden zum Bezahlen`);
|
||||
|
||||
if (!args[0]) {
|
||||
return message.channel.send(embed1);
|
||||
}
|
||||
let embed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie können nicht selbst bezahlen`);
|
||||
|
||||
if (user.user.id === message.author.id) {
|
||||
return message.channel.send(embed2);
|
||||
}
|
||||
|
||||
let embed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen zu zahlenden Betrag an`);
|
||||
|
||||
if (!args[1]) {
|
||||
return message.channel.send(embed3);
|
||||
}
|
||||
let embed4 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen gültigen Betrag ein!`);
|
||||
|
||||
if (isNaN(args[1])) {
|
||||
return message.channel.send(embed4);
|
||||
}
|
||||
let embed5 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast nicht so viel Geld`);
|
||||
|
||||
if (member < args[1]) {
|
||||
return message.channel.send(embed5);
|
||||
}
|
||||
|
||||
let embed6 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben ${user.displayName} ${args[1]} Coins bezahlt`);
|
||||
|
||||
message.channel.send(embed6);
|
||||
db.add(`money_${user.id}`, args[1]);
|
||||
db.subtract(`money_${user2.id}`, args[1]);
|
||||
} catch {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,34 @@
|
|||
const { MessageEmbed }= require("discord.js");
|
||||
const db = require("quick.db");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "removemoney",
|
||||
aliases: ["rm"],
|
||||
category: "economy",
|
||||
description: "Entfernt Geld von einem Benutzer",
|
||||
usage: "[ mention | ID]",
|
||||
accessableby: "Administrator, Owner"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
if (!message.member.hasPermission("ADMINISTRATOR", "MANAGE_GUILD")) return message.channel.send("❌ Sie sind nicht berechtigt, Geld zu entfernen!");
|
||||
if (!args[0]) return message.channel.send("**Bitte geben Sie einen Benutzer ein!**")
|
||||
|
||||
let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(r => r.user.username.toLowerCase() === args[0].toLocaleLowerCase()) || message.guild.members.cache.find(r => r.displayName.toLowerCase() === args[0].toLocaleLowerCase());
|
||||
if (!user) return message.channel.send("**Bitte geben Sie einen gültigen Benutzer ein!**")
|
||||
|
||||
if (!args[1]) return message.channel.send("**Bitte geben Sie einen Betrag ein!**")
|
||||
if (isNaN(args[1])) return message.channel.send("**Gültigen Betrag eingeben!**");
|
||||
let bal = await db.fetch(`money_${user.id}`)
|
||||
|
||||
if (args[0] > bal) return message.channel.send("**So viel Geld kann nicht entfernt werden!**")
|
||||
db.subtract(`money_${user.id}`, args[1])
|
||||
let bal2 = await db.fetch(`money_${user.id}`)
|
||||
|
||||
let moneyEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ ${args[1]} Münzen entfernt\n\nNeues Guthaben: ${bal2}`);
|
||||
message.channel.send(moneyEmbed)
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
const { default_prefix } = require('../../config');
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "roulette",
|
||||
aliases: ["roul"],
|
||||
category: "economy",
|
||||
description: "Bet a colour to win or lose",
|
||||
usage: "[colour]<amount>",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let prefix = "q"
|
||||
let fetched = await db.fetch(`prefix_${message.guild.id}`);
|
||||
|
||||
if (fetched === null) {
|
||||
fetched = prefix
|
||||
} else {
|
||||
prefix = fetched
|
||||
}
|
||||
|
||||
let user = message.author;
|
||||
|
||||
function isOdd(num) {
|
||||
if ((num % 2) == 0) return false;
|
||||
else if ((num % 2) == 1) return true;
|
||||
}
|
||||
|
||||
let colour = args[0];
|
||||
let money = parseInt(args[1]);
|
||||
let moneydb = await db.fetch(`money_${user.id}`)
|
||||
|
||||
let random = Math.floor((Math.random() * 10));
|
||||
|
||||
let moneyhelp = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen Spielbetrag an | ${prefix}Roulette <color> <amount>`);
|
||||
|
||||
let moneymore = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie setzen mehr als Sie haben`);
|
||||
|
||||
let colorbad = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie eine Farbe an | Red [1.5x] (normal) Black [2x] (hard) Green [15x](rare)`);
|
||||
|
||||
if (!colour) return message.channel.send(colorbad);
|
||||
colour = colour.toLowerCase()
|
||||
if (!money) return message.channel.send(moneyhelp);
|
||||
if (money > moneydb) return message.channel.send(moneymore);
|
||||
|
||||
if (colour == "b" || colour.includes("black")) colour = 0;
|
||||
else if (colour == "r" || colour.includes("red")) colour = 1;
|
||||
else if (colour == "g" || colour.includes("green")) colour = 2;
|
||||
else return message.channel.send(colorbad);
|
||||
|
||||
if (random == 1 && colour == 2) { // Green
|
||||
money *= 15
|
||||
db.add(`money_${user.id}`, money)
|
||||
let moneyEmbed1 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Du hast gewonnen ${money} Münzen\n\nMultiplikator: 15x`);
|
||||
message.channel.send(moneyEmbed1)
|
||||
} else if (isOdd(random) && colour == 1) { // Red
|
||||
money = parseInt(money * 1.5)
|
||||
db.add(`money_${user.id}`, money)
|
||||
let moneyEmbed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`🔴 Du hast gewonnen ${money} Münzen\n\nMultiplikator: 1.5x`);
|
||||
message.channel.send(moneyEmbed2)
|
||||
} else if (!isOdd(random) && colour == 0) { // Black
|
||||
money = parseInt(money * 2)
|
||||
db.add(`money_${user.id}`, money)
|
||||
let moneyEmbed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`⬛ Du hast gewonnen ${money} Münzen\n\nMultiplikator: 2x`);
|
||||
message.channel.send(moneyEmbed3)
|
||||
} else { // Wrong
|
||||
db.subtract(`money_${user.id}`, money)
|
||||
let moneyEmbed4 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast verloren ${money} Münzen\n\nMultiplikator:: 0x`);
|
||||
message.channel.send(moneyEmbed4)
|
||||
}
|
||||
db.add(`games_${user.id}`, 1)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
const { MessageEmbed } = require('discord.js');
|
||||
const db = require('quick.db');
|
||||
const { default_prefix } = require('../../config')
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "sell",
|
||||
noalias: [""],
|
||||
category: "economy",
|
||||
description: "An jemanden verkaufen",
|
||||
usage: "[mention | ID] <amount>",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let prefix;
|
||||
let fetched = await db.fetch(`prefix_${message.guild.id}`);
|
||||
|
||||
if (fetched === null) {
|
||||
fetched = prefix
|
||||
} else {
|
||||
prefix = fetched
|
||||
}
|
||||
let user = message.author;
|
||||
|
||||
if (args.join(' ').toLocaleLowerCase() == 'nikes') {
|
||||
let embed1 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast keine Nikes zu verkaufen`);
|
||||
|
||||
let nikees = await db.fetch(`nikes_${user.id}`)
|
||||
|
||||
if (nikees < 1) return message.channel.send(embed1)
|
||||
|
||||
db.fetch(`nikes_${user.id}`)
|
||||
db.subtract(`nikes_${user.id}`, 1)
|
||||
|
||||
let embed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Verkaufe frische Nikes für 600 Münzen`);
|
||||
|
||||
db.add(`money_${user.id}`, 600)
|
||||
message.channel.send(embed2)
|
||||
} else if (args.join(' ').toLocaleLowerCase() == 'car') {
|
||||
let embed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie haben kein Auto zu verkaufen`);
|
||||
|
||||
let cars = await db.fetch(`car_${user.id}`)
|
||||
|
||||
if (cars < 1) return message.channel.send(embed3)
|
||||
|
||||
db.fetch(`car_${user.id}`)
|
||||
db.subtract(`car_${user.id}`, 1)
|
||||
|
||||
let embed4= new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Verkaufe ein Auto für 800 Münzen`);
|
||||
|
||||
db.add(`money_${user.id}`, 800)
|
||||
message.channel.send(embed4)
|
||||
} else if (args.join(' ').toLocaleLowerCase() == 'mansion') {
|
||||
let sembed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie haben keine Villa zu verkaufen`);
|
||||
|
||||
let houses = await db.fetch(`house_${user.id}`)
|
||||
|
||||
if (houses < 1) return message.channel.send(sembed2)
|
||||
|
||||
db.fetch(`house_${user.id}`)
|
||||
db.subtract(`house_${user.id}`, 1)
|
||||
|
||||
let sembed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Habe eine Villa für 1200 Münzen verkauft`);
|
||||
|
||||
db.add(`money_${user.id}`, 1200)
|
||||
message.channel.send(sembed3)
|
||||
} else {
|
||||
if (message.content.toLowerCase() === `${prefix}sell`) {
|
||||
let embed9 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen zu verkaufenden Artikel ein. Geben Sie ${prefix}store ein, um die Liste der Artikel anzuzeigen`)
|
||||
return message.channel.send(embed9)
|
||||
} else {
|
||||
return message.channel.send("**Kein gültiger Artikel!**")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
const slotItems = ["🍇", "🍉", "🍌", "🍎", "🍒"];
|
||||
const db = require("quick.db");
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
|
||||
name:"slots",
|
||||
aliases: ["sl"],
|
||||
category: "economy",
|
||||
description: "Slot-Spiel | 9x - selten | 3x - häufig",
|
||||
usage: "<amount>",
|
||||
accessableby: ""
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
|
||||
let user = message.author;
|
||||
let moneydb = await db.fetch(`money_${user.id}`)
|
||||
let money = parseInt(args[0]);
|
||||
let win = false;
|
||||
|
||||
let moneymore = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie setzen mehr als Sie haben`);
|
||||
|
||||
let moneyhelp = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen Betrag an`);
|
||||
|
||||
if (!money) return message.channel.send(moneyhelp);
|
||||
if (money > moneydb) return message.channel.send(moneymore);
|
||||
|
||||
let number = []
|
||||
for (let i = 0; i < 3; i++) { number[i] = Math.floor(Math.random() * slotItems.length); }
|
||||
|
||||
if (number[0] == number[1] && number[1] == number[2]) {
|
||||
money *= 9
|
||||
win = true;
|
||||
} else if (number[0] == number[1] || number[0] == number[2] || number[1] == number[2]) {
|
||||
money *= 3
|
||||
win = true;
|
||||
}
|
||||
if (win) {
|
||||
let slotsEmbed1 = new MessageEmbed()
|
||||
.setDescription(`${slotItems[number[0]]} | ${slotItems[number[1]]} | ${slotItems[number[2]]}\n\nDu hast Münzen im Wert von ${money} gewonnen`)
|
||||
.setColor("GREEN")
|
||||
message.channel.send(slotsEmbed1)
|
||||
db.add(`money_${user.id}`, money)
|
||||
} else {
|
||||
let slotsEmbed = new MessageEmbed()
|
||||
.setDescription(`${slotItems[number[0]]} | ${slotItems[number[1]]} | ${slotItems[number[2]]}\n\nDu hast Münzen im Wert von ${money} Verloren`)
|
||||
.setColor("GREEN")
|
||||
message.channel.send(slotsEmbed)
|
||||
db.subtract(`money_${user.id}`, money)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
const { MessageEmbed } = require('discord.js');
|
||||
const { default_prefix } = require('../../config');
|
||||
const db = require('quick.db');
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "shop",
|
||||
noalias: [""],
|
||||
category: "economy",
|
||||
description: "Zeigt eine Liste mit Artikeln an",
|
||||
usage: " ",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
let prefix;
|
||||
let fetched = await db.fetch(`prefix_${message.guild.id}`);
|
||||
let g = [1 , 2, 3, 4, null]
|
||||
if (fetched === null) {
|
||||
prefix = default_prefix
|
||||
} else {
|
||||
prefix = fetched
|
||||
}
|
||||
|
||||
|
||||
let embed = new MessageEmbed()
|
||||
.setDescription(`** SHOP: **\n PadLock: \`500$\`\n Sie können Ihr Portemonnaie mit einem Vorhängeschloss sichern\n\n [${prefix}buy/${prefix}sell PadLock]\n\n LapTop : \`800$\`
|
||||
Mit dem Laptop kannst du online etwas Geld verdienen 💰
|
||||
[${prefix}buy/${prefix}sell Laptop] \n\nAngelrute: \`1600$\`
|
||||
Sie können Fische kaufen und etwas Geld verdienen.
|
||||
[${prefix}buy/${prefix}sell Fishing Rod]\n\nJagdgewehr: \`2000$\`
|
||||
Mit dem Jagdgewehr kannst du ein Tier fangen und Geld verdienen. [${prefix}buy/${prefix}sell Hunting Rifle]\n\nBanknote: \`2600$\`
|
||||
Sie können den Speicherplatz Ihrer Bank auf 100 bis 5000 erhöhen. [${prefix}buy/${prefix}sell Bank Note]
|
||||
`)
|
||||
.setColor("BLUE")
|
||||
.setFooter(`Erstellt von ${message.author.username}`)
|
||||
message.channel.send(embed)
|
||||
if(args[0] === "2"){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
const ms = require("parse-ms");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "coins-system",
|
||||
aliases: ["week"],
|
||||
category: "economy",
|
||||
description: "Gibt Ihnen 5000 pro Tag",
|
||||
usage: " ",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
|
||||
let user = message.author;
|
||||
let timeout = 604800000;
|
||||
let amount = 5000;
|
||||
|
||||
let weekly = await db.fetch(`weekly_${user.id}`);
|
||||
|
||||
if (weekly !== null && timeout - (Date.now() - weekly) > 0) {
|
||||
let time = ms(timeout - (Date.now() - weekly));
|
||||
|
||||
let timeEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie haben Ihre wöchentliche Prämie bereits abgeholt\n\nHolen Sie sie in ${time.days}d ${time.hours}h ${time.minutes}m ${time.seconds}s erneut ab `);
|
||||
message.channel.send(timeEmbed)
|
||||
} else {
|
||||
let moneyEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben Ihre wöchentliche Prämie in Höhe von ${amount} Münzen gesammelt`);
|
||||
message.channel.send(moneyEmbed)
|
||||
db.add(`money_${user.id}`, amount)
|
||||
db.set(`weekly_${user.id}`, Date.now())
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
const { MessageEmbed } = require("discord.js");
|
||||
const db = require("quick.db");
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "withdraw",
|
||||
aliases: ["wd"],
|
||||
category: "economy",
|
||||
description: "Geld von der Bank abheben",
|
||||
usage: "<amount>",
|
||||
|
||||
run: async (bot, message, args) => {
|
||||
let user = message.author;
|
||||
|
||||
let member2 = db.fetch(`bank_${user.id}`)
|
||||
|
||||
if (args.join(' ').toLocaleLowerCase() == 'all') {
|
||||
let money = await db.fetch(`bank_${user.id}`)
|
||||
let embed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌**Sie haben kein Geld zum Abheben!**`)
|
||||
if (!money) return message.channel.send(embed)
|
||||
db.subtract(`bank_${user.id}`, money)
|
||||
db.add(`money_${user.id}`, money)
|
||||
let embed5 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben alle Ihre Coins von Ihrer Bank abgehoben`);
|
||||
message.channel.send(embed5)
|
||||
|
||||
} else {
|
||||
|
||||
let embed2 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Geben Sie einen Auszahlungsbetrag an!`);
|
||||
|
||||
if (!args[0]) {
|
||||
return message.channel.send(embed2)
|
||||
}
|
||||
let embed6 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Your Amount Is Not A Number!`)
|
||||
|
||||
if(isNaN(args[0])) {
|
||||
return message.channel.send(embed6)
|
||||
}
|
||||
let embed3 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie können kein negatives Geld abheben!`);
|
||||
|
||||
if (message.content.includes('-')) {
|
||||
return message.channel.send(embed3)
|
||||
}
|
||||
let embed4 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Du hast nicht so viel Geld auf der Bank!`);
|
||||
|
||||
if (member2 < args[0]) {
|
||||
return message.channel.send(embed4)
|
||||
}
|
||||
|
||||
let embed5 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ Sie haben ${args[0]}-Münzen von Ihrer Bank abgehoben!`);
|
||||
|
||||
message.channel.send(embed5)
|
||||
db.subtract(`bank_${user.id}`, args[0])
|
||||
db.add(`money_${user.id}`, args[0])
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
const db = require('quick.db')
|
||||
const { MessageEmbed } = require('discord.js')
|
||||
const ms = require("parse-ms");
|
||||
const Jwork = require('../../JSON/works.json');
|
||||
const JworkR = Jwork[Math.floor(Math.random() * Jwork.length)];
|
||||
|
||||
module.exports = {
|
||||
|
||||
name: "work",
|
||||
aliases: ["wr"],
|
||||
category: "economy",
|
||||
description: "Arbeiten, um Geld zu verdienen",
|
||||
usage: " ",
|
||||
accessableby: "everyone"
|
||||
,
|
||||
run: async (bot, message, args) => {
|
||||
|
||||
let user = message.author;
|
||||
let author = await db.fetch(`work_${user.id}`)
|
||||
|
||||
let timeout = 1800000;
|
||||
|
||||
if (author !== null && timeout - (Date.now() - author) > 0) {
|
||||
let time = ms(timeout - (Date.now() - author));
|
||||
|
||||
let timeEmbed = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`❌ Sie haben bereits vor Kurzem gearbeitet\n\nVersuchen Sie es in ${time.minutes}m ${time.seconds}s erneut`);
|
||||
message.channel.send(timeEmbed)
|
||||
} else {
|
||||
let amount = Math.floor(Math.random() * 80) + 1;
|
||||
let embed1 = new MessageEmbed()
|
||||
.setColor("GREEN")
|
||||
.setDescription(`✅ **${JworkR} ${amount}**`)
|
||||
message.channel.send(embed1)
|
||||
|
||||
db.add(`works_${user.id}`, 1)
|
||||
db.add(`money_${user.id}`, amount)
|
||||
db.set(`work_${user.id}`, Date.now())
|
||||
};
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue