Dateien nach "commands/alt-detector" hochladen
This commit is contained in:
parent
38360d90ea
commit
15a0d94f6a
|
@ -0,0 +1,107 @@
|
|||
const Discord = require("discord.js")
|
||||
const db = require("../../database");
|
||||
let cooldown = new Set();
|
||||
const config = require("../../config")
|
||||
|
||||
module.exports = {
|
||||
name: "auto-setup",
|
||||
aliases: ['autosetup'],
|
||||
description: "autosetup the bot",
|
||||
category: "alt-detector",
|
||||
run: async (client, message, member) => {
|
||||
|
||||
|
||||
if (!message.member.hasPermission("MANAGE_GUILD")) {
|
||||
await message.delete()
|
||||
return message.channel.send(`**Sie haben keine Berechtigung, diesen Befehl zu verwenden**`)
|
||||
}
|
||||
|
||||
if(cooldown.has(message.author.id)) {
|
||||
message = await
|
||||
message.channel.send({embed: {color: "#10de47", description: `**You need to wait __${config.COOLDOWN}__ Minuten, um diesen Befehl erneut zu verwenden!**`}});
|
||||
setTimeout(() => {
|
||||
message.delete();
|
||||
}, 3000);
|
||||
} else {
|
||||
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setColor('RANDOM')
|
||||
.setTitle("AUTO SETUP")
|
||||
.setTimestamp()
|
||||
.setFooter("Bot von M_Viper#8085");
|
||||
|
||||
let xd = await message.channel.send(embed)
|
||||
xd.react("✅")
|
||||
xd.react("❌")
|
||||
|
||||
const filter = (reaction, user) => {
|
||||
return ['✅', '❌'].includes(reaction.emoji.name) && user.id === message.author.id;
|
||||
};
|
||||
|
||||
xd.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
|
||||
.then(async collected => {
|
||||
const reaction = collected.first();
|
||||
|
||||
if (reaction.emoji.name === '✅') {
|
||||
let channel = client.channels.cache.find(x => x.name === "alt-logging")
|
||||
if (channel) {
|
||||
channel.delete().catch(console.log)
|
||||
}
|
||||
await message.guild.channels.create('alt-logging', {
|
||||
type: 'text',
|
||||
permissionsOverwrites: [{
|
||||
id: message.guild.id,
|
||||
deny: ['SEND_MESSAGES'],
|
||||
allow: ['VIEW_CHANNEL']
|
||||
}]
|
||||
})
|
||||
let role = message.guild.roles.cache.find(role => role.name === "alt-notify")
|
||||
if (role) {
|
||||
role.delete().catch(console.log)
|
||||
}
|
||||
await message.guild.roles.create({
|
||||
data: {
|
||||
name: 'alt-notify',
|
||||
color: 'RANDOM',
|
||||
}
|
||||
})
|
||||
|
||||
let LoggingChannel = client.channels.cache.find(x => x.name === "alt-logging")
|
||||
await db.delete(`LoggingChannel_${message.guild.id}`)
|
||||
await db.set(`LoggingChannel_${message.guild.id}`, LoggingChannel.id)
|
||||
|
||||
let notifyRole = message.guild.roles.cache.find(role => role.name === "alt-notify")
|
||||
await db.delete(`notifyRole_${message.guild.id}`)
|
||||
await db.set(`notifyRole_${message.guild.id}`, notifyRole)
|
||||
|
||||
let AutoSetupEmbed = new Discord.MessageEmbed()
|
||||
.setColor("RANDOM")
|
||||
.setDescription(`**__Automatisches Setup wird ausgeführt__** \n **Bitte warten Sie eine Weile ....**`)
|
||||
.setFooter("Bot von M_Viper#8085");
|
||||
|
||||
let AutoSetupDoneEmbed = new Discord.MessageEmbed()
|
||||
.setColor("RANDOM")
|
||||
.setDescription(`**__AUTO SETUP FERTIG__** \n **Nun ist Alt Logging Channel ${LoggingChannel} \n Und Alt Notify Role ist ${notifyRole}**`)
|
||||
.setFooter("Bot von M_Viper#8085");
|
||||
|
||||
message = await
|
||||
message.channel.send(AutoSetupEmbed)
|
||||
setTimeout(() => {
|
||||
message.edit(AutoSetupDoneEmbed);
|
||||
}, 1000);
|
||||
} else {
|
||||
message.reply('In Ordnung ! Vorgang wurde abgebrochen');
|
||||
}
|
||||
})
|
||||
.catch(collected => {
|
||||
if(xd.reactions.cache.size !== null) return
|
||||
else message.reply(`Zeit vorbei ! Du hast nicht reagiert`);
|
||||
})
|
||||
}
|
||||
cooldown.add(message.author.id);
|
||||
setTimeout(() => {
|
||||
cooldown.delete(message.author.id);
|
||||
}, config.COOLDOWN * 60 * 1000);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,214 @@
|
|||
const Discord = require("discord.js");
|
||||
const ms = require("ms");
|
||||
const db = require("../../database");
|
||||
|
||||
module.exports = {
|
||||
name: "config",
|
||||
aliases: ["config"],
|
||||
description: "sets config",
|
||||
category: "alt-detector",
|
||||
run: async (client, message, member) => {
|
||||
//args
|
||||
const args = message.content.split(" ").slice(1);
|
||||
|
||||
if (!message.member.hasPermission("MANAGE_GUILD")) {
|
||||
await message.delete()
|
||||
return message.channel.send(`**You Dont Have Permission To Use This Command**`)
|
||||
}
|
||||
|
||||
const config = new Discord.MessageEmbed()
|
||||
.setTitle(`CONFIG`)
|
||||
.setDescription(`
|
||||
✨ \`s!config logChannel\` - ( **__Sets The logging Channel__** )
|
||||
__VARIABLES__
|
||||
\`s!config logchannel #alt-notify\`
|
||||
✨ \`s!config notifyRole\` - ( **__Sets The Notify Role__** )
|
||||
__VARIABLES__
|
||||
\`s!config notifyrole @alt-notify\`
|
||||
✨ \`s!config altAge\` - ( **__Sets The Alt Age__** )
|
||||
__VARIABLES__
|
||||
\`s!config altage 31\`
|
||||
✨ \`s!config autokick\` - ( **__Sets AutoKick Configs__** )
|
||||
__VARIABLES__
|
||||
\`s!config autokick enable\` (To Enable AutoKick)
|
||||
\`s!config autokick disable\` (To Disable Autokick)
|
||||
\`s!config autokick set 7\` (To Kick Alts Below The Number Of Days Setted)
|
||||
✨ \`s!config whitelist\` - ( **__Set The Whitelist User__** )
|
||||
__VARIABLES__
|
||||
\`s!config whitelist {user id}\` (AutoKick System Will Not Kick That User)
|
||||
✨ \`s!config remove\` - ( **__Removes The Specific Config__** )
|
||||
__VARIABLES__
|
||||
\`s!config remove logchannel\` (Removes Alt Logging Channel)
|
||||
\`s!config remove notifyrole\` (Removes Alt Notify Role)
|
||||
\`s!config remove altage\` (Removes AltAge)
|
||||
\`s!config remove autokickage\` (Removes AutoKick Age)
|
||||
\`s!config remove whitelist\` (Removes Whitelist User)
|
||||
`)
|
||||
.setColor(`RANDOM`)
|
||||
|
||||
if (args[0] === undefined) {
|
||||
return message.channel.send(config)
|
||||
}
|
||||
|
||||
if (args[0].toLowerCase() === "logchannel") {
|
||||
args.shift();
|
||||
|
||||
let LoggingChannel = message.mentions.channels.first();
|
||||
|
||||
if (!LoggingChannel)
|
||||
return message.channel.send(`**BITTE EINEN GÜLTIGEN KANAL ERWÄHNEN**`);
|
||||
|
||||
var guildicon = message.guild.iconURL();
|
||||
|
||||
const succes = new Discord.MessageEmbed()
|
||||
.setTitle(`Alternativer Logging-Kanal wurde eingestellt!`)
|
||||
.setDescription(`New Channel is ${LoggingChannel}`)
|
||||
.setThumbnail(guildicon)
|
||||
.setFooter("Bot Made By ItzCutePichu#0001");
|
||||
|
||||
db.delete(`LoggingChannel_${message.guild.id}`);
|
||||
|
||||
db.set(`LoggingChannel_${message.guild.id}`, LoggingChannel.id);
|
||||
|
||||
message.channel.send(succes);
|
||||
|
||||
} else if (args[0].toLowerCase() === "notifyrole") {
|
||||
args.shift();
|
||||
|
||||
let LoggingChannel = message.mentions.channels.first();
|
||||
|
||||
if (!LoggingChannel)
|
||||
return message.channel.send(`**BITTE GEBEN SIE EINEN GÜLTIGEN KANAL AN**`);
|
||||
|
||||
var guildicon = message.guild.iconURL();
|
||||
|
||||
const succes = new Discord.MessageEmbed()
|
||||
.setTitle(`Alternativer Logging-Kanal wurde eingestellt!`)
|
||||
.setDescription(`Neuer Kanal ist ${LoggingChannel}`)
|
||||
.setThumbnail(guildicon)
|
||||
.setFooter("Bot von M_Viper#8085");
|
||||
|
||||
db.delete(`LoggingChannel_${message.guild.id}`);
|
||||
|
||||
db.set(`LoggingChannel_${message.guild.id}`, LoggingChannel.id);
|
||||
|
||||
message.channel.send(succes);
|
||||
|
||||
} else if(args[0].toLowerCase() === "altage") {
|
||||
args.shift();
|
||||
|
||||
let altage = Number(args[0])
|
||||
|
||||
if (!altage) {
|
||||
return message.channel.send(`**Bitte geben Sie die Tage \n__IN FORMAT__ an: 30 [FÜR 30 TAGE]**`)
|
||||
}
|
||||
|
||||
if (altage > 120) {
|
||||
return message.channel.send(`**Huh ! ${message.author} You Can't Set Age Above __\`120\`__ Days**`)
|
||||
}
|
||||
var guildicon = message.guild.iconURL();
|
||||
|
||||
const succes = new Discord.MessageEmbed()
|
||||
.setTitle(`AltAge has been Setted!`)
|
||||
.setDescription(`New AltAge is \`${altage}\` Days`)
|
||||
.setThumbnail(guildicon)
|
||||
.setFooter("Bot von M_Viper#8085");
|
||||
|
||||
message.channel.send(succes);
|
||||
|
||||
db.delete(`altAge_${message.guild.id}`)
|
||||
db.set(`altAge_${message.guild.id}`, altage)
|
||||
|
||||
} else if(args[0].toLowerCase(0) === "autokick") {
|
||||
args.shift();
|
||||
|
||||
if (args[0] === "enable") {
|
||||
|
||||
db.set(`AutoKick_${message.guild.id}`, true)
|
||||
db.delete(`AutoKickAge_${message.guild.id}`)
|
||||
db.set(`AutoKickAge_${message.guild.id}`, 8)
|
||||
message.channel.send(`**AutoKick Has Been __Enabled__** \nAutokick Age is \`8\` Days By Default`)
|
||||
|
||||
} else if (args[0] === 'disable') {
|
||||
db.delete(`AutoKick_${message.guild.id}`)
|
||||
message.channel.send(`**AutoKick Has Been __Disabled__**`)
|
||||
|
||||
} else if (args[0] === 'set') {
|
||||
|
||||
let autokickage = Number(args[1])
|
||||
|
||||
if (!autokickage) {
|
||||
return message.channel.send(`**Please Specify The AutoKick Age \n__IN FORMAT__ : 7 [FOR 7 DAYS]**`)
|
||||
}
|
||||
|
||||
if (autokickage > 31) {
|
||||
return message.channel.send(`**Huh ! ${message.author} You Can't Set Age Above __\`31\`__ Days**`)
|
||||
}
|
||||
var guildicon = message.guild.iconURL();
|
||||
|
||||
const succes = new Discord.MessageEmbed()
|
||||
.setTitle(`AutoKick Age has been Setted!`)
|
||||
.setDescription(`New AltAge is \`${autokickage}\` Days`)
|
||||
.setThumbnail(guildicon)
|
||||
.setFooter("Bot von M_Viper#8085");
|
||||
|
||||
message.channel.send(succes);
|
||||
|
||||
db.delete(`AutokickAge_${message.guild.id}`)
|
||||
db.set(`AutokickAge_${message.guild.id}`, autokickage)}
|
||||
|
||||
} else if (args[0].toLowerCase() === "whitelist") {
|
||||
args.shift()
|
||||
|
||||
|
||||
let Whitelist = args[0]
|
||||
|
||||
if (!Whitelist) return message.channel.send(`**Please Tell The WhiteList User ID To Set**`)
|
||||
|
||||
if(isNaN(Whitelist)) return message.channel.send(`**Please Tell The Valid ID \nFor Example \`!config whiteList 533955330829451275\`**`)
|
||||
|
||||
db.delete(`WhiteListed_${message.guild.id}`)
|
||||
db.set(`WhiteListed_${message.guild.id}`, Whitelist)
|
||||
|
||||
let whitelisted = new Discord.MessageEmbed()
|
||||
.setTitle(`NEW WHITELIST USER SETTED`)
|
||||
.setDescription(`
|
||||
__Some Details About User__
|
||||
**__ID__** - ${Whitelist}
|
||||
***__NOTE__*** - **YOU CAN ONLY SET ONE WHITELIST USER ID THE PREVIOUS ID WILL BE DELETED AUTOMATICALLY**`)
|
||||
message.channel.send(whitelisted)
|
||||
|
||||
} else if (args[0].toLowerCase() === "remove") {
|
||||
args.shift()
|
||||
|
||||
if (args[0].toLowerCase(0) === 'logchannel') {
|
||||
db.delete(`LoggingChannel_${message.guild.id}`)
|
||||
message.channel.send(`**Logging Channel Has Been Removed**`)
|
||||
}
|
||||
|
||||
if (args[0].toLowerCase() === "notifyrole") {
|
||||
db.delete(`notifyRole_${message.guild.id}`)
|
||||
message.channel.send(`**NotifyRole Has Been Removed**`)
|
||||
}
|
||||
|
||||
if (args[0].toLowerCase() === "altage") {
|
||||
db.delete(`altAge_${message.guild.id}`)
|
||||
message.channel.send(`**AltAge Has Been Removed** \n**But Its \`31\` By Default**`)
|
||||
}
|
||||
|
||||
if (args[0].toLowerCase() === "autokickage") {
|
||||
db.delete(`AutoKickAge_${message.guild.id}`)
|
||||
message.channel.send(`**AutoKick Age Has Been Removed** \n**But Its \`8\` By Default**`)
|
||||
}
|
||||
|
||||
if (args[0].toLowerCase() === "whitelist") {
|
||||
db.delete(`WhiteListed_${message.guild.id}`)
|
||||
message.channel.send(`**WhiteList User Has Been Removed**`)
|
||||
}
|
||||
|
||||
} else message.channel.send("Unknown config variable...")
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
|
@ -0,0 +1,74 @@
|
|||
const discord = require('discord.js')
|
||||
const db = require("../../database")
|
||||
const chalk = require('chalk')
|
||||
|
||||
module.exports = {
|
||||
name: "settings",
|
||||
aliases: ['setting'],
|
||||
description: "shows settings",
|
||||
category: "alt-detector",
|
||||
run: async (client, message, member) => {
|
||||
|
||||
let logChannel = await db.get(`LoggingChannel_${message.guild.id}`)
|
||||
let NotifyRole = await db.get(`notifyRole_${message.guild.id}`)
|
||||
let AltAge = await db.get(`altAge_${message.guild.id}`)
|
||||
let AltData = await db.get(`AutoKick_${message.guild.id}`)
|
||||
let AutoKickAge = await db.get(`AutokickAge_${message.guild.id}`)
|
||||
let WhiteListed = await db.get(`WhiteListed_${message.guild.id}`)
|
||||
|
||||
let channel = `<#${logChannel}>`
|
||||
let role = `<@&${NotifyRole}>`
|
||||
let age = `${AltAge} Days`
|
||||
let WhiteListedUser = `${WhiteListed}`
|
||||
let date = `${AutoKickAge} Days`
|
||||
|
||||
if (WhiteListed === null) {
|
||||
WhiteListedUser = "NO USER ID IS WHITELISTED"
|
||||
}
|
||||
|
||||
if (AutoKickAge === null) {
|
||||
date = "**8 [BY DEFAULT]**"
|
||||
}
|
||||
|
||||
if (AltData === true) {
|
||||
AltData = "ENABLED"
|
||||
} else {
|
||||
date = "DISABLED"
|
||||
}
|
||||
|
||||
if (logChannel === null) {
|
||||
channel = "NO CHANNEL FOUND"
|
||||
}
|
||||
|
||||
if (NotifyRole === null) {
|
||||
role = "NO ROLE FOUND"
|
||||
}
|
||||
|
||||
if (AltAge === null) {
|
||||
age = "**31 Days [BY DEFAULT]**"
|
||||
}
|
||||
|
||||
let embed = new discord.MessageEmbed()
|
||||
.setTitle(`CONFIG SETTINGS`)
|
||||
.setDescription(`
|
||||
__**ALT LOG CHANNEL**__
|
||||
➡ ${channel}
|
||||
__**ALT NOTIFY ROLE**__
|
||||
➡ ${role}
|
||||
__**ALT ACCOUNT AGE**__
|
||||
➡ ${age}
|
||||
__**AUTO KICK CMD STATUS**__
|
||||
➡ ${AltData || 'DISABLED'}
|
||||
__**AUTOKICK AGE**__
|
||||
➡ ${date}
|
||||
__**WHITE LISTED USER**__
|
||||
➡ ${WhiteListedUser}
|
||||
`)
|
||||
|
||||
|
||||
|
||||
message.channel.send(embed)
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue