1 |
import { BanOptions, CommandInteraction, Emoji, GuildChannel, GuildMember, Interaction, Message, TextChannel, User } from 'discord.js'; |
import { BanOptions, CommandInteraction, Emoji, GuildChannel, GuildMember, Interaction, Message, TextChannel, User, Permissions } 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'; |
12 |
|
|
13 |
export default class ClearCommand extends BaseCommand { |
export default class ClearCommand extends BaseCommand { |
14 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
15 |
|
permissions = [Permissions.FLAGS.MANAGE_MESSAGES]; |
16 |
|
|
17 |
constructor() { |
constructor() { |
18 |
super('clear', 'moderation', []); |
super('clear', 'moderation', []); |
95 |
try { |
try { |
96 |
const member = await msg.guild?.members.fetch(user.id); |
const member = await msg.guild?.members.fetch(user.id); |
97 |
|
|
98 |
if (member && !(await hasPermissions(client, member, msg, null, "You don't have permission to clear messages from this user."))) |
if (member && !(await hasPermission(client, member, msg, null, "You don't have permission to clear messages from this user."))) |
99 |
return; |
return; |
100 |
|
|
101 |
if (member && shouldNotModerate(client, member)) { |
if (member && shouldNotModerate(client, member)) { |