1 |
import { BanOptions, CommandInteraction, GuildMember, Interaction, Message, Permissions, User } from 'discord.js'; |
import { CommandInteraction, GuildMember, 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'; |
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 History from '../../automod/History'; |
|
7 |
import getMember from '../../utils/getMember'; |
import getMember from '../../utils/getMember'; |
8 |
import ms from 'ms'; |
import ms from 'ms'; |
|
import { unmute } from './UnmuteCommand'; |
|
9 |
import PunishmentType from '../../types/PunishmentType'; |
import PunishmentType from '../../types/PunishmentType'; |
10 |
import { hasPermission, shouldNotModerate } from '../../utils/util'; |
import { hasPermission, shouldNotModerate } from '../../utils/util'; |
11 |
|
|
35 |
} |
} |
36 |
|
|
37 |
if (dateTime && timeInterval) { |
if (dateTime && timeInterval) { |
38 |
await client.db.get("INSERT INTO unmutes(user_id, guild_id, time) VALUES(?, ?, ?)", [user.id, msg.guild!.id, new Date(dateTime).toISOString()], async (err: any) => { |
await setTimeoutv2('unmute-job', timeInterval, msg.guild!.id, `unmute ${user.id}`, msg.guild!.id, user.id); |
|
if (err) |
|
|
console.log(err); |
|
|
|
|
|
console.log('A timeout has been set.'); |
|
|
|
|
|
await setTimeoutv2('unmute-job', timeInterval, msg.guild!.id, `unmute ${user.id}`, msg.guild!.id, user.id); |
|
|
}); |
|
39 |
} |
} |
40 |
|
|
41 |
if (hard) { |
if (hard) { |