trying to handle music

This commit is contained in:
DeSqBlocki
2024-08-02 13:25:06 +02:00
parent a74e19be5a
commit 2925fb59dd
42 changed files with 3708 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require("discord.js")
const { mClient } = require("../..")
require('dotenv').config()
module.exports = {
name: 'honor_menu_history',
description: 'show selected user honor history',
async execute(interaction) {
let description = interaction.message.embeds[0].data.description
const target = await interaction.guild.members.fetch(description.split(' ')[0].slice(2, -1))
const db = mClient.db(process.env.M_DB)
const reasonsColl = db.collection('honor-reasons')
const history = await reasonsColl.findOne({ userID: target.user.id })
const embed = new EmbedBuilder()
.setTitle('- Honor History -')
.setDescription(`${target} - ${target.user.globalName ?? target.user.username}`)
.setThumbnail(target.displayAvatarURL())
.setFooter({text: 'Um zurückzukehren, wähle einen Nutzer!'})
if(history){
let temp = ''
history.reasons.forEach(reason => {
temp += reason + '\r\n'
})
embed.setDescription(temp)
}
const select = await interaction.message.components[0]
const row = await interaction.message.components[1]
await interaction.reply({
embeds: [embed],
components: [select, row],
ephemeral: true
})
}
}