Dateien nach "commands/owner" hochladen

This commit is contained in:
M_Viper 2024-02-07 14:48:26 +00:00
parent e083345324
commit 28b41a75f2
5 changed files with 281 additions and 0 deletions

View File

@ -0,0 +1,131 @@
const Discord = require("discord.js");
const ownerid = "612686200318459914";
module.exports = {
name: "serverlist",
aliases: ["slt"],
category: "owner",
description: "Zeigt die Liste der Server an!",
usage: " ",
run: async (bot, message, args) => {
if (message.author.id == ownerid) {
if (!message.guild.me.hasPermission("ADMINISTRATOR"))
return message.channel
.send("Ich habe keine Berechtigungen")
.then(msg => msg.delete({ timeout: 5000 }));
let i0 = 0;
let i1 = 10;
let page = 1;
let description =
`Total Servers - ${bot.guilds.cache.size}\n\n` +
bot.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.map(r => r)
.map((r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} Members\nID - ${r.id}`)
.slice(0, 10)
.join("\n\n");
let embed = new Discord.MessageEmbed()
.setAuthor(bot.user.tag, bot.user.displayAvatarURL({dynamic : true}))
.setColor("00FFFF")
.setFooter(`Page - ${page}/${Math.ceil(bot.guilds.cache.size / 10)}`)
.setDescription(description);
let msg = await message.channel.send(embed);
await msg.react("⬅");
await msg.react("➡");
await msg.react("❌");
let collector = msg.createReactionCollector(
(reaction, user) => user.id === message.author.id
);
collector.on("collect", async (reaction, user) => {
if (reaction._emoji.name === "⬅") {
// Updates variables
i0 = i0 - 10;
i1 = i1 - 10;
page = page - 1;
// if there is no guild to display, delete the message
if (i0 + 1 < 0) {
console.log(i0)
return msg.delete();
}
if (!i0 || !i1) {
return msg.delete();
}
description =
`Total Servers - ${bot.guilds.cache.size}\n\n` +
bot.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.map(r => r)
.map(
(r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} Members\nID - ${r.id}`)
.slice(i0, i1)
.join("\n\n");
// Update the embed with new informations
embed
.setFooter(
`Page - ${page}/${Math.round(bot.guilds.cache.size / 10 + 1)}`
)
.setDescription(description);
// Edit the message
msg.edit(embed);
}
if (reaction._emoji.name === "➡") {
// Updates variables
i0 = i0 + 10;
i1 = i1 + 10;
page = page + 1;
// if there is no guild to display, delete the message
if (i1 > bot.guilds.cache.size + 10) {
return msg.delete();
}
if (!i0 || !i1) {
return msg.delete();
}
description =
`Total Servers - ${bot.guilds.cache.size}\n\n` +
bot.guilds.cache
.sort((a, b) => b.memberCount - a.memberCount)
.map(r => r)
.map(
(r, i) => `**${i + 1}** - ${r.name} | ${r.memberCount} Members\nID - ${r.id}`)
.slice(i0, i1)
.join("\n\n");
// Update the embed with new informations
embed
.setFooter(
`Page - ${page}/${Math.round(bot.guilds.cache.size / 10 + 1)}`
)
.setDescription(description);
// Edit the message
msg.edit(embed);
}
if (reaction._emoji.name === "❌") {
return msg.delete();
}
// Remove the reaction when the user react to the message
await reaction.users.remove(message.author.id);
});
} else {
return;
}
}
};

43
commands/owner/eval.js Normal file
View File

@ -0,0 +1,43 @@
const { MessageEmbed } = require('discord.js');
const Discord = require('discord.js');
const client = new Discord.Client()
module.exports = {
name: 'eval',
category: 'owner',
run: async (client, message, args) => {
if (message.author.id !== '612686200318459914') return message.channel.send("Sie haben keine Berechtigung, diesen Befehl zu verwenden!");
const embed = new MessageEmbed()
.setTitle('Auswerten...')
const msg = await message.channel.send(embed);
try {
const data = eval(args.join(' ').replace(/```/g, ''));
const embed = new MessageEmbed()
.setTitle('output:')
.setDescription(await data)
.setColor('GREEN')
await msg.edit(embed)
await msg.react('✅')
await msg.react('❌')
const filter = (reaction, user) => (reaction.emoji.name === '❌' || reaction.emoji.name === '✅') && (user.id === message.author.id);
msg.awaitReactions(filter, { max: 1 })
.then((collected) => {
collected.map((emoji) => {
switch (emoji._emoji.name) {
case '✅':
msg.reactions.removeAll();
break;
case '❌':
msg.delete()
break;
}
})
})
} catch (e) {
const embed = new MessageEmbed()
.setTitle('error')
.setDescription(e)
.setColor("#FF0000")
return await msg.edit(embed);
}
}
}

46
commands/owner/getinv.js Normal file
View File

@ -0,0 +1,46 @@
const ownerid = "612686200318459914";
module.exports = {
name: "getinvite",
aliases: ['getinv', 'gi'],
category: "owner",
description: "Generiert eine Einladung an den betreffenden Server.",
usage: "[ID | name]",
run: async(bot, message, args) => {
if (message.author.id === ownerid) {
let guild = null;
if (!args[0]) return message.channel.send("Geben Sie den Gildennamen oder die Gilden-ID des gewünschten Einladungslinks ein.")
if(args[0]){
let fetched = bot.guilds.cache.find(g => g.name === args.join(" "));
let found = bot.guilds.cache.get(args[0]);
if(!found) {
if(fetched) {
guild = fetched;
}
} else {
guild = found
}
} else {
return message.channel.send("Das ist der ungültige Gildenname");
}
if(guild){
let tChannel = guild.channels.cache.find(ch => ch.type == "text" && ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE"));
if(!tChannel) {
return message.channel.send("Tut mir leid, ich habe dort keine CREATE_INSTANT_INVITE-Berechtigung!");
}
let invite = await tChannel.createInvite({ temporary: false, maxAge: 0 }).catch(err => {
return message.channel.send(`${err} ist aufgetreten!`);
});
message.channel.send(invite.url);
} else {
return message.channel.send(`\`${args.join(' ')}\` - Ich bin nicht auf diesem Server.`);
}
} else {
return;
}
}
}

1
commands/owner/lol Normal file
View File

@ -0,0 +1 @@

60
commands/owner/stats.js Normal file
View File

@ -0,0 +1,60 @@
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "ainfo",
description: "`Detaillierte Statistiken des Bots anzeigen`",
category: "owner",
aliases: ["detail"],
run: async (client, message, args, level) => {
//command
if(message.author.id != 612686200318459914){
const noperms = new MessageEmbed()
.setDescription("<:astroz_wrong:825598313499459605> Dieser Befehl wird nur von meinem Besitzer verwendet **NPG**")
.setColor("YELLOW");
return message.channel.send(noperms)
}
let servers_count = message.client.guilds.cache.size;
var myarray = [];
message.client.guilds.cache.keyArray().forEach(async function(item, index) {
let guildMember = message.client.guilds.cache.get(item).memberCount;
myarray.push(guildMember)
})
let sum = myarray.reduce(function (a, b) {
return a + b
});
let totalSeconds = message.client.uptime / 1000;
let days = Math.floor(totalSeconds / 86400);
totalSeconds %= 86400;
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
let seconds = Math.floor(totalSeconds % 60);
let uptime = `\`\`\`${days} days, ${hours} hours, ${minutes} minutes and ${seconds} seconds\`\`\``;
let embed = new MessageEmbed()
.setTitle(`**[Support Server]**`)
.setDescription(`Hey, mein Name ist **${message.client.user.username}** und meine Arbeit ist Spaßmodus usw.`)
.setTitle(`${message.client.user.username} Stats`)
.addFields(
{ name: "<:servers:822736807883440161> Servers:", value: `\`\`\`${servers_count}\`\`\``, inline: true },
{ name: "<:users:822737049740247070> Users:", value: `\`\`\`${sum}\`\`\``, inline: true },
{ name: "<:astrozchannels:832228652569329665> Channels",value: `\`\`\`${message.client.channels.cache.size}\`\`\``, inline: true },
{ name: "<a:uptime:822736925495394314> Uptime: ", value: uptime , inline: true },
{ name: "<a:astorzping:825420347112554496> Ping:",value: `\`\`\`${Math.round(message.client.ws.ping)} ms\`\`\``, inline: true },
{ name: "<:astroz_ram:822500018639994920> RAM: ", value: `\`\`\`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB\`\`\``, inline: true },
{ name: "<a:Owner:612686200318459914> Bot Owner:",value: `\`\`\`NPG\`\`\``},
)
.setColor("3498DB")
.setFooter("Danke für die Wahl von Difficult-Knights BOT")
return message.channel.send(embed);
return message.react("<:astroz_correct:825597747800309770>");
}
};
console.log("Statistiken funktionieren")