- Defer the voice commands' reply: updating every member can take longer than the 3 seconds Discord allows; one member leaving no longer fails the whole operation. - Replace the deprecated ephemeral option with MessageFlags, answer command errors in French and log when that answer itself fails; route autocomplete interactions to the command. - Add /readyz, which answers 503 while the bot is not connected to Discord. - Run npm ci and npm run check on every push; deploy main only when they pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
827 B
JavaScript
19 lines
827 B
JavaScript
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js";
|
|
import { changeVoiceStatus } from "../../features/utilities.js";
|
|
import { requirePermission } from "../../features/permissions.js";
|
|
|
|
const command = {
|
|
data: new SlashCommandBuilder()
|
|
.setName("muteall")
|
|
.setDescription("Mute tout le monde dans le lounge")
|
|
.setDefaultMemberPermissions(PermissionFlagsBits.MuteMembers),
|
|
async execute(interaction) {
|
|
if (!(await requirePermission(interaction, PermissionFlagsBits.MuteMembers))) return;
|
|
// Changer l'état de chaque membre peut dépasser les 3 s qu'accorde Discord pour répondre.
|
|
await interaction.deferReply();
|
|
await changeVoiceStatus(interaction.client, "mute", "all");
|
|
await interaction.editReply("Voila, tout le monde est mioute ! 🐱");
|
|
},
|
|
};
|
|
|
|
export { command };
|