Added basic template of report feat.

Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
Louis Hollingworth 2023-05-07 21:08:51 +01:00
parent c3f77419b1
commit ae2dbc6c70
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
2 changed files with 15 additions and 1 deletions

View file

@ -60,7 +60,7 @@ async function run() {
// await importx(__dirname + "/{events,commands}/**/*.{ts,js}"); // await importx(__dirname + "/{events,commands}/**/*.{ts,js}");
// The following syntax should be used in the ECMAScript environment // 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 // Let's start the bot
if (!process.env.DISCORD_TOKEN) { if (!process.env.DISCORD_TOKEN) {

14
src/menus/report.ts Normal file
View file

@ -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});
}
}