1 |
import { BanOptions, CommandInteraction, GuildMember, Interaction, Message, User } from 'discord.js'; |
import { BanOptions, CommandInteraction, GuildMember, Interaction, Message, Permissions, 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'; |
57 |
user_id: user.id, |
user_id: user.id, |
58 |
roles: roles.map(role => role.id), |
roles: roles.map(role => role.id), |
59 |
guild_id: msg.guild!.id, |
guild_id: msg.guild!.id, |
60 |
|
createdAt: new Date() |
61 |
}); |
}); |
62 |
} |
} |
63 |
|
|
73 |
reason, |
reason, |
74 |
meta: { |
meta: { |
75 |
time: timeInterval ? ms(timeInterval) : undefined |
time: timeInterval ? ms(timeInterval) : undefined |
76 |
} |
}, |
77 |
|
createdAt: new Date() |
78 |
}); |
}); |
79 |
|
|
80 |
await client.logger.logMute(user, reason === undefined || reason.trim() === '' ? "*No reason provided*" : reason, timeInterval, msg.member!.user as User, hard); |
await client.logger.logMute(user, reason === undefined || reason.trim() === '' ? "*No reason provided*" : reason, timeInterval, msg.member!.user as User, hard); |
121 |
|
|
122 |
export default class MuteCommand extends BaseCommand { |
export default class MuteCommand extends BaseCommand { |
123 |
supportsInteractions: boolean = true; |
supportsInteractions: boolean = true; |
124 |
|
permissions = [Permissions.FLAGS.MODERATE_MEMBERS]; |
125 |
|
|
126 |
constructor() { |
constructor() { |
127 |
super('mute', 'moderation', []); |
super('mute', 'moderation', []); |