1 |
import { BanOptions, CommandInteraction, EmojiIdentifierResolvable, GuildMember, Interaction, Message, Permissions, Role, TextChannel, User } from 'discord.js'; |
import { CommandInteraction, Message, Role, TextChannel, User } from 'discord.js'; |
2 |
import BaseCommand from '../../utils/structures/BaseCommand'; |
import BaseCommand from '../../utils/structures/BaseCommand'; |
3 |
import DiscordClient from '../../client/Client'; |
import DiscordClient from '../../client/Client'; |
4 |
import CommandOptions from '../../types/CommandOptions'; |
import CommandOptions from '../../types/CommandOptions'; |
5 |
import InteractionOptions from '../../types/InteractionOptions'; |
import InteractionOptions from '../../types/InteractionOptions'; |
6 |
import MessageEmbed from '../../client/MessageEmbed'; |
import MessageEmbed from '../../client/MessageEmbed'; |
|
import getUser from '../../utils/getUser'; |
|
|
import getMember from '../../utils/getMember'; |
|
|
import History from '../../automod/History'; |
|
|
import { fetchEmoji } from '../../utils/Emoji'; |
|
7 |
|
|
8 |
export default class LockCommand extends BaseCommand { |
export default class LockCommand extends BaseCommand { |
9 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
24 |
channel = await <TextChannel> options.options.getChannel('channel'); |
channel = await <TextChannel> options.options.getChannel('channel'); |
25 |
} |
} |
26 |
|
|
27 |
if (options.options.getChannel('role')) { |
if (options.options.getRole('role')) { |
28 |
role = await <Role> options.options.getRole('role'); |
role = await <Role> options.options.getRole('role'); |
29 |
} |
} |
30 |
} |
} |
76 |
let error = null; |
let error = null; |
77 |
|
|
78 |
if (!result) { |
if (!result) { |
79 |
error = 'This channel is already locked.'; // If you want to force unlock, run this command with `--force` option or select `True` if using slash commands.'; |
error = 'This channel is already locked' + (role.id === msg.guild!.id ? '' : ' for the given role') + '.'; |
80 |
} |
} |
81 |
|
|
82 |
if (error) { |
if (error) { |