A powerful and extendable Discord bot, with it's own module system :3
thevoid.cafe/projects/voidy
1import { MessageFlags, type ButtonInteraction, type ChatInputCommandInteraction } from "discord.js";
2import type { Middleware } from "../types/Middleware";
3
4export const devOnly: Middleware<ChatInputCommandInteraction | ButtonInteraction> = async (
5 interaction,
6 client,
7 next,
8) => {
9 if (!client.developers.includes(interaction.user.id)) {
10 await interaction.reply({
11 content: "You are not authorized to use this command.",
12 flags: [MessageFlags.Ephemeral],
13 });
14 return;
15 }
16
17 await next();
18};