This commit is contained in:
Axel Olausson Holtenäs 2022-03-13 19:15:45 +01:00
commit a13652a276

View file

@ -46,14 +46,14 @@ module.exports = async (interaction) => {
const counterExist = await counters.findOne({
guildId: member.guild.id,
channelId: channel.id,
word: word,
word,
});
if (!counterExist) {
await counters.create({
guildId: member.guild.id,
channelId: channel.id,
word: word,
word,
counter: start || 0,
});
// Create embed object
@ -72,19 +72,18 @@ module.exports = async (interaction) => {
`Guild: ${member.guild.id} User: ${member.id} added ${channel.id} as a counter using word "${word}" for counting.`
);
// Send interaction reply
return await interaction.editReply({ embeds: [embed] });
} else {
// Create embed object
const embed = {
title: 'Admin - Counter',
description: `${channel} is already a counting channel.`,
timestamp: new Date(),
color: config.colors.error,
footer: { iconURL: config.footer.icon, text: config.footer.text },
};
// Send interaction reply
return await interaction.editReply({ embeds: [embed] });
}
// Create embed object
const embed = {
title: 'Admin - Counter',
description: `${channel} is already a counting channel.`,
timestamp: new Date(),
color: config.colors.error,
footer: { iconURL: config.footer.icon, text: config.footer.text },
};
// Send interaction reply
return await interaction.editReply({ embeds: [embed] });
};