added mognodb database

This commit is contained in:
2025-01-30 20:15:50 +01:00
parent c913661109
commit 8fd4ed237b
11 changed files with 326 additions and 7 deletions
+44
View File
@@ -0,0 +1,44 @@
const { SlashCommandBuilder } = require("discord.js");
module.exports = {
data: new SlashCommandBuilder()
.setName("mute")
.setDescription("mute misbehaving people")
.addUserOption(option =>
option
.setName('target')
.setDescription('The member to mute')
.setRequired(true))
.addIntegerOption(option =>
option
.setName('duration')
.setDescription('The duration of the Mute (Minutes)')
.setRequired(true))
.addStringOption(option =>
option
.setName('reason')
.setDescription('The reason of the mute')),
async execute(interaction) {
// Get the user and duration from the command options
const target = interaction.options.getUser('target');
const duration = interaction.options.getInteger('duration');
// Convert duration to milliseconds
const durationMs = duration * 60 * 1000;
try {
// Apply the timeout
await target.timeout(durationMs);
await interaction.reply({
content: `${target.tag} has been muted for ${duration} minutes.`
});
} catch (error) {
console.error(error);
await interaction.reply({
content: 'I was unable to mute the member.',
ephemeral: true,
});
}
},
};
View File