-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathhide.js
More file actions
57 lines (47 loc) · 1.45 KB
/
hide.js
File metadata and controls
57 lines (47 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
const { ApplicationCommandOptionType, EmbedBuilder } = require('discord.js');
module.exports = {
name: 'hide',
description: 'Hides a channel',
category: 'ADMIN',
userPermissions: ['ManageChannels'],
command: {
enabled: true,
usage: '<channel>',
minArgsCount: 1,
},
slashCommand: {
enabled: false,
ephemeral: true,
options: [
{
name: 'channel',
description: 'Channel to hide',
type: ApplicationCommandOptionType.Channel,
required: true,
},
],
},
async messageRun(message, args) {
const channel = message.mentions.channels.first();
if (!channel) return message.channel.send('Please enter a channel to hide');
await channel.permissionOverwrites.edit(message.guild.roles.everyone, {
'ViewChannel': false,
});
const embed = new EmbedBuilder()
.setTitle('✅ **Channel Hidden**')
.setDescription(`${channel} is now hidden from everyone.`)
.setColor('#e74c3c');
channel.send({ embeds: [embed] });
},
async interactionRun(interaction) {
const channel = interaction.options.getChannel('channel');
await channel.permissionOverwrites.edit(interaction.guild.roles.everyone, {
'ViewChannel': false,
});
const embed = new EmbedBuilder()
.setTitle('✅ **Channel Hidden**')
.setDescription(`${channel} is now hidden from everyone.`)
.setColor('#e74c3c');
interaction.followUp({ embeds: [embed] });
},
};