Added info dump command
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const { SlashCommandBuilder, PermissionFlagsBits, userMention, EmbedBuilder } = require('discord.js');
|
const { SlashCommandBuilder, PermissionFlagsBits, userMention, EmbedBuilder, ChannelType } = require('discord.js');
|
||||||
const { hypixelGuildID, color } = require('../config/options.json');
|
const { hypixelGuildID, color } = require('../config/options.json');
|
||||||
|
const { muted } = require('../config/roles.json');
|
||||||
const verify = require('../schemas/verifySchema.js');
|
const verify = require('../schemas/verifySchema.js');
|
||||||
const env = require('dotenv').config();
|
const env = require('dotenv').config();
|
||||||
const dev = process.env.DEV;
|
const dev = process.env.DEV;
|
||||||
@@ -33,6 +34,10 @@ module.exports = {
|
|||||||
option
|
option
|
||||||
.setName('count')
|
.setName('count')
|
||||||
.setDescription('Count of messages to purge reactions from.')))
|
.setDescription('Count of messages to purge reactions from.')))
|
||||||
|
.addSubcommand(subcommand =>
|
||||||
|
subcommand
|
||||||
|
.setName('updatemutedrolepermissions')
|
||||||
|
.setDescription('Update the permissions of the muted role.'))
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
@@ -127,5 +132,42 @@ module.exports = {
|
|||||||
await interaction.editReply(`Purged reactions from ${count} message(s).`)
|
await interaction.editReply(`Purged reactions from ${count} message(s).`)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (subcommand === 'updatemutedrolepermissions') {
|
||||||
|
|
||||||
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
|
const guild = interaction.guild;
|
||||||
|
const voiceChannels = guild.channels.cache.filter(channel => channel.type === ChannelType.GuildVoice);
|
||||||
|
const textChannels = guild.channels.cache.filter(channel => channel.type === ChannelType.GuildText);
|
||||||
|
const mutedRole = guild.roles.cache.get(muted);
|
||||||
|
|
||||||
|
// for (const channel of voiceChannels) {
|
||||||
|
// await channel[1].permissionOverwrites.create(mutedRole, [
|
||||||
|
// {
|
||||||
|
// id: mutedRole,
|
||||||
|
// deny: [PermissionFlagsBits.Speak, PermissionFlagsBits.SendMessages]
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: guild.roles.everyone,
|
||||||
|
// deny: [PermissionFlagsBits.Connect, PermissionFlagsBits.ViewChannel]
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// id: "722386801930797056",
|
||||||
|
// allow: [PermissionFlagsBits.Connect, PermissionFlagsBits.ViewChannel]
|
||||||
|
// }
|
||||||
|
// ])
|
||||||
|
// }
|
||||||
|
|
||||||
|
const channel = guild.channels.cache.get("1108161929882636380");
|
||||||
|
|
||||||
|
await channel.permissionOverwrites.edit("961891974472953906", {
|
||||||
|
2097152: true,
|
||||||
|
2048: true
|
||||||
|
})
|
||||||
|
|
||||||
|
await interaction.editReply({ content: 'Updated permissions for voice channels.', ephemeral: true })
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user