bugfix: default permissions for members to use commands
This commit is contained in:
parent
4ab74597b7
commit
4e3cfacfa4
@ -1,10 +1,11 @@
|
|||||||
import { ChannelType, SlashCommandBuilder } from 'discord.js';
|
import { ChannelType, PermissionFlagsBits, SlashCommandBuilder } from 'discord.js';
|
||||||
import { VoiceChannel } from '../../../database.js';
|
import { VoiceChannel } from '../../../database.js';
|
||||||
|
|
||||||
export const data = new SlashCommandBuilder()
|
export const data = new SlashCommandBuilder()
|
||||||
.setName('custom_vc')
|
.setName('custom_vc')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDescription('Manages reactions for self roles.')
|
.setDescription('Manages reactions for self roles.')
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageChannels)
|
||||||
.addSubcommand((subcommand) =>
|
.addSubcommand((subcommand) =>
|
||||||
subcommand
|
subcommand
|
||||||
.setName('create')
|
.setName('create')
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { TextInputBuilder, TextInputStyle } from 'discord.js';
|
import { PermissionFlagsBits, TextInputBuilder, TextInputStyle } from 'discord.js';
|
||||||
import {
|
import {
|
||||||
ModalBuilder,
|
ModalBuilder,
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
@ -10,7 +10,8 @@ import { addSelfRoles } from '../../../../shared.js';
|
|||||||
export const data = new ContextMenuCommandBuilder()
|
export const data = new ContextMenuCommandBuilder()
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setName('Add role emoji pair')
|
.setName('Add role emoji pair')
|
||||||
.setType(ApplicationCommandType.Message);
|
.setType(ApplicationCommandType.Message)
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles);
|
||||||
export async function modalSubmit(interaction) {
|
export async function modalSubmit(interaction) {
|
||||||
const { fields, guild } = interaction;
|
const { fields, guild } = interaction;
|
||||||
// Get text inputs from modal
|
// Get text inputs from modal
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { Message } from '../../../../database.js';
|
import { Message } from '../../../../database.js';
|
||||||
import { ApplicationCommandType, ContextMenuCommandBuilder } from 'discord.js';
|
import { ApplicationCommandType, ContextMenuCommandBuilder, PermissionFlagsBits } from 'discord.js';
|
||||||
|
|
||||||
export const data = new ContextMenuCommandBuilder()
|
export const data = new ContextMenuCommandBuilder()
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setName('Register self roles')
|
.setName('Register self roles')
|
||||||
.setType(ApplicationCommandType.Message);
|
.setType(ApplicationCommandType.Message)
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles);
|
||||||
export async function execute(interaction) {
|
export async function execute(interaction) {
|
||||||
const id = interaction.targetMessage.id;
|
const id = interaction.targetMessage.id;
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { removeSelfRoles } from '../../../../shared.js';
|
import { removeSelfRoles } from '../../../../shared.js';
|
||||||
import { ApplicationCommandType, ContextMenuCommandBuilder } from 'discord.js';
|
import { ApplicationCommandType, ContextMenuCommandBuilder, PermissionFlagsBits } from 'discord.js';
|
||||||
|
|
||||||
export const data = new ContextMenuCommandBuilder()
|
export const data = new ContextMenuCommandBuilder()
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setName('Remove self roles')
|
.setName('Remove self roles')
|
||||||
.setType(ApplicationCommandType.Message);
|
.setType(ApplicationCommandType.Message)
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles);
|
||||||
export async function execute(interaction) {
|
export async function execute(interaction) {
|
||||||
const id = interaction.targetMessage.id;
|
const id = interaction.targetMessage.id;
|
||||||
await removeSelfRoles(interaction, id);
|
await removeSelfRoles(interaction, id);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { addSelfRoles } from '../../../shared.js';
|
import { addSelfRoles } from '../../../shared.js';
|
||||||
import { SlashCommandBuilder } from 'discord.js';
|
import { PermissionFlagsBits, SlashCommandBuilder } from 'discord.js';
|
||||||
import { Message } from '../../../database.js';
|
import { Message } from '../../../database.js';
|
||||||
|
|
||||||
const createSelfRoles = async (interaction) => {
|
const createSelfRoles = async (interaction) => {
|
||||||
@ -73,6 +73,7 @@ export const data = new SlashCommandBuilder()
|
|||||||
.setName('self_roles')
|
.setName('self_roles')
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDescription('Manages reactions for self roles.')
|
.setDescription('Manages reactions for self roles.')
|
||||||
|
.setDefaultMemberPermissions(PermissionFlagsBits.ManageRoles)
|
||||||
.addSubcommand((subcommand) =>
|
.addSubcommand((subcommand) =>
|
||||||
subcommand
|
subcommand
|
||||||
.setName('create')
|
.setName('create')
|
||||||
|
Loading…
Reference in New Issue
Block a user