dank mr panda
dank mr panda
DIdiscord.js - Imagine ❄
Created by dank mr panda on 9/2/2023 in #djs-questions
Restrict slash cmds to admins and me
How would i make my slash commands only be available to admins of a server and to me? heres my slash cmd code
require('dotenv').config();
const { REST, Routes, ApplicationCommandOptionType } = require('discord.js');

const commands = [
{
name: 'log-channel',
description: 'Sets chosen Channel as Log Channel',
options: [
{
name: 'channel',
description: 'Choose the channel you want logs to be in',
type: ApplicationCommandOptionType.Channel,
channel_types: [0],
required: true,
},
],
},
{
name: 'logs',
description: 'Replies with current log channel',
},
];
require('dotenv').config();
const { REST, Routes, ApplicationCommandOptionType } = require('discord.js');

const commands = [
{
name: 'log-channel',
description: 'Sets chosen Channel as Log Channel',
options: [
{
name: 'channel',
description: 'Choose the channel you want logs to be in',
type: ApplicationCommandOptionType.Channel,
channel_types: [0],
required: true,
},
],
},
{
name: 'logs',
description: 'Replies with current log channel',
},
];
discord.js: 14.13.0 node: 20.5.1
25 replies