if (interaction.isModalSubmit()) {
if (interaction.customId === 'modal_xd') {
try {
const changelogValue = interaction.fields.getTextInputValue("changelog");
const changelog = require('../database/changelogSchema');
const CP = await changelog.findOne({
ident: "counter",
});
const date2 = new Date().toLocaleDateString();
if (CP)
await CP.update({
changelog: `${changelogValue}`,
date: `${date2}`,
type: interaction.options.getString("type")
})
client.warn("[Manager] Updated Quadro's changelog.")
interaction.reply({ embeds: [
new MessageEmbed()
.setTitle("Updated changelog!")
.addFields(
{
name: "Message",
value: changelogValue
},
{
name: "Type",
value: interaction.options.getString("type")
},
{
name: "Date",
value: date2
}
)
.setColor(client.config.embedColor)
], ephemeral: true
})
} catch (error) {
client.error(error)
}
}
}
if (interaction.isModalSubmit()) {
if (interaction.customId === 'modal_xd') {
try {
const changelogValue = interaction.fields.getTextInputValue("changelog");
const changelog = require('../database/changelogSchema');
const CP = await changelog.findOne({
ident: "counter",
});
const date2 = new Date().toLocaleDateString();
if (CP)
await CP.update({
changelog: `${changelogValue}`,
date: `${date2}`,
type: interaction.options.getString("type")
})
client.warn("[Manager] Updated Quadro's changelog.")
interaction.reply({ embeds: [
new MessageEmbed()
.setTitle("Updated changelog!")
.addFields(
{
name: "Message",
value: changelogValue
},
{
name: "Type",
value: interaction.options.getString("type")
},
{
name: "Date",
value: date2
}
)
.setColor(client.config.embedColor)
], ephemeral: true
})
} catch (error) {
client.error(error)
}
}
}