Add membership checks for slash commands

This commit is contained in:
Skylar Grant 2025-03-31 20:21:37 -04:00
parent df9a3a0eba
commit 93251348a3

View File

@ -39,6 +39,7 @@ client.once('ready', async () => {
fn.collections.dotCommands(client);
fn.collections.setvalidCommands(client);
fn.collections.roaches(client);
fn.collections.memberships(client);
await fn.download.gifs(client);
await fn.download.pastas(client);
await fn.download.joints(client);
@ -68,7 +69,11 @@ client.on('interactionCreate', async interaction => {
}
if (client.slashCommands.has(commandName)) {
client.slashCommands.get(commandName).execute(interaction);
if (fn.checkMembership(client, interaction.user.id)) {
client.slashCommands.get(commandName).execute(interaction);
} else {
interaction.reply(fn.embeds.noMembership());
}
} else {
interaction.reply('Sorry, I don\'t have access to that command.');
console.error('Slash command attempted to run but not found: ' + commandName);