From ae2dbc6c70ee44e0ff70e56d5a46d52b955c3b98 Mon Sep 17 00:00:00 2001 From: Louis Hollingworth Date: Sun, 7 May 2023 21:08:51 +0100 Subject: [PATCH] Added basic template of report feat. Signed-off-by: Louis Hollingworth --- src/main.ts | 2 +- src/menus/report.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/menus/report.ts diff --git a/src/main.ts b/src/main.ts index e10b8c1..9b3c5fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -60,7 +60,7 @@ async function run() { // await importx(__dirname + "/{events,commands}/**/*.{ts,js}"); // The following syntax should be used in the ECMAScript environment - await importx(`${dirname(import.meta.url)}/{events,commands}/**/*.{ts,js}`); + await importx(`${dirname(import.meta.url)}/{events,commands,menus}/**/*.{ts,js}`); // Let's start the bot if (!process.env.DISCORD_TOKEN) { diff --git a/src/menus/report.ts b/src/menus/report.ts new file mode 100644 index 0000000..5148b1f --- /dev/null +++ b/src/menus/report.ts @@ -0,0 +1,14 @@ +import { ApplicationCommandType, MessageContextMenuCommandInteraction } from "discord.js"; +import { ContextMenu, Discord } from "discordx"; + +@Discord() +export class Report { + @ContextMenu({ + name: "Report user", + type: ApplicationCommandType.User, + }) + reportUser(interaction: MessageContextMenuCommandInteraction) { + interaction.reply({content: "Reported user " + interaction.targetId, ephemeral: true}); + } +} +