all repos — stealth-developers @ 7f079d8ff07713cc317b566bceb3fe34b42c4ce0

src/interactions/commands/report.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
import type { ICommand } from "@/types";
import {
	ActionRowBuilder,
	ButtonBuilder,
	type ButtonInteraction,
	ButtonStyle,
	type Client,
} from "discord.js";

export async function buttonExecute(
	client: Client,
	interaction: ButtonInteraction,
) {
	const message = interaction.message;
	await interaction.reply({
		content: "Thank you.",
		flags: ["Ephemeral"],
	});

	const agreedButton = new ActionRowBuilder<ButtonBuilder>().addComponents(
		new ButtonBuilder()
			.setCustomId("report:agreed")
			.setLabel("I confirm that my report follows the rules")
			.setDisabled(true)
			.setStyle(ButtonStyle.Success),
	);

	await message.edit({
		content: message.content,
		components: [agreedButton],
	});
}

export default {
	buttonExecute,
} satisfies ICommand;