Dateien nach "commands/suggestion" hochladen

This commit is contained in:
M_Viper 2024-02-07 14:48:48 +00:00
parent 28b41a75f2
commit 51c1724784
4 changed files with 153 additions and 0 deletions

1
commands/suggestion/lol Normal file
View File

@ -0,0 +1 @@

View File

@ -0,0 +1,87 @@
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const db = require("quick.db");
module.exports = {
name: "sreply",
category: "suggestion",
run: async (client, message, args) => {
let channel = await db.fetch(`suggestion_${message.guild.id}`);
if (channel === null) return;
if(!message.member.hasPermission('MANAGE_GUILD')) return;
const rgx = /^(?:<@!?)?(\d+)>?$/;
const messageID = args[0];
const replyQuery = args.slice(1).join(' ');
const number = new MessageEmbed()
.setDescription(`<:bfdno:832931445991276584> | Ich glaube nicht, dass das eine Nachrichten-ID war!`)
.setColor("FF2052")
const id = new MessageEmbed()
.setDescription(`<:bfdno:832931445991276584> |Sie haben vergessen, die Nachrichten-ID anzugeben!`)
.setColor("FF2052")
const query = new MessageEmbed()
.setDescription(`<:bfdno:832931445991276584> | Sie haben vergessen, die Antwort anzugeben!`)
.setColor("FF2052")
const reply = new MessageEmbed()
.setDescription(`<:bfdyes:832931453892558848> | Vorschlag erfolgreich beantwortet.`)
.setColor("00FFFF")
const noChannel = new MessageEmbed()
.setDescription(`<:bfdno:832931445991276584> | Kein Vorschlagskanal gefunden!`)
.setColor("FF2052")
const noMessage = new MessageEmbed()
.setDescription(`<:bfdno:832931445991276584> | Keine Nachricht mit dieser ID gefunden!`)
.setColor("FF2052")
if(!messageID) return message.channel.send(id);
if (!rgx.test(messageID)) return message.channel.send(number);
if(!replyQuery) return message.channel.send(query)
try{
const suggestionChannel = message.guild.channels.cache.get(channel)
if(!suggestionChannel) return message.channel.send(noChannel)
const suggestedEmbed = await suggestionChannel.messages.fetch(messageID).catch(error => {
const noMessage = new MessageEmbed()
.setDescription(`<:bfdno:832931445991276584> | Keine Nachricht mit dieser ID gefunden!`)
.setColor("FF2052")
return message.channel.send(noMessage);
})
const data = suggestedEmbed.embeds[0];
const replyEmbed = new MessageEmbed()
.setAuthor(`${data.author.name}`, data.author.iconURL)
.setDescription(data.description)
.setColor("BLUE")
.addField(`Reply from ${message.author.tag}`, replyQuery)
.setFooter("Status: Replied")
.setTimestamp();
suggestedEmbed.edit(replyEmbed)
message.channel.send(reply)
const user = await client.users.cache.find((u) => u.tag === data.author.name)
const embed = new MessageEmbed()
.setDescription(`Sie haben eine Antwort auf Ihren Vorschlag erhalten <:bfdyes:832931453892558848> . **[Message Link](https://discord.com/channels/${message.guild.id}/${channel}/${messageID})**`)
.setColor("BLUE")
user.send(embed)
} catch(err) {
return;
}
}
}

View File

@ -0,0 +1,29 @@
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const db = require("quick.db");
module.exports = {
name: "setsuggest",
category: "suggestion",
usage: "setsuggest <#channel>",
authorPermission: ["MANAGE_GUILD"],
run: async (client, message, args) => {
if (!message.member.hasPermission("MANAGE_GUILD")) {
return message.channel.send(`Sie haben keine Berechtigung, diesen Befehl zu verwenden! Server verwalten`)
}
let Channel = message.mentions.channels.first() || message.guild.channels.cache.get(args[0]);
if (!Channel) return message.channel.send(`Bitte erwähnen Sie einen Kanal!`);
if (Channel.type === "voice") return message.channel.send(`Bitte erwähnen Sie einen Textkanal!`);
await db.set(`suggestion_${message.guild.id}`, Channel.id);
let Embed = new MessageEmbed()
.setColor("00FFFF")
.setDescription(`Vorschlagskanal ist eingestellt als <#${Channel.id}>`)
return message.channel.send(Embed);
}
};

View File

@ -0,0 +1,36 @@
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const db = require("quick.db");
module.exports = {
name: "suggest",
category:"suggestion",
run: async (client, message, args) => {
let channel = await db.fetch(`suggestion_${message.guild.id}`);
if (channel === null) return;
const suggestionQuery = args.join(" ");
if(!suggestionQuery) return message.reply("Bitte schlagen Sie etwas vor.");
const embed = new MessageEmbed()
.setAuthor(message.author.tag, message.author.displayAvatarURL({dynamic: true}))
.setDescription(`${suggestionQuery}`)
.setColor("00FFFF")
.setFooter("Status: Pending")
.setTimestamp();
const done = new MessageEmbed()
.setDescription(`<:bfdyes:832931453892558848> | Ihr Vorschlag wird hier eingereicht, <#${channel}>\n\nNote: Sie haben zugestimmt, eine Direktnachricht auf eine Antwort auf Ihren Vorschlag zu erhalten!`)
.setColor("00FFFF")
message.channel.send(done)
let msgEmbed = await message.guild.channels.cache.get(channel).send(embed)
await msgEmbed.react('<:upvote:832931955556745236>')
await msgEmbed.react('<:downvote:832931677294428161> ')
}
}