1 |
import { CommandInteraction, GuildMember, Interaction, Message, TextChannel } from 'discord.js'; |
import { CommandInteraction, Message, TextChannel } 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 Help from '../../utils/help'; |
|
7 |
import ms from 'ms'; |
import ms from 'ms'; |
|
import { timeSince } from '../../utils/util'; |
|
8 |
import { setTimeoutv2 } from '../../utils/setTimeout'; |
import { setTimeoutv2 } from '../../utils/setTimeout'; |
9 |
|
|
10 |
export default class ExpireCommand extends BaseCommand { |
export default class ExpireCommand extends BaseCommand { |
62 |
|
|
63 |
text = args.join(' '); |
text = args.join(' '); |
64 |
} |
} |
65 |
|
|
66 |
|
if (!channel.send) { |
67 |
|
await msg.reply({ |
68 |
|
content: 'Invalid text channel.', |
69 |
|
ephemeral: true |
70 |
|
}); |
71 |
|
|
72 |
|
return; |
73 |
|
} |
74 |
|
|
75 |
try { |
try { |
76 |
const message = await channel.send({ |
const message = await channel.send({ |
77 |
content: text! |
content: text! |
78 |
}); |
}); |
79 |
|
|
80 |
const timeout = await setTimeoutv2('expire.ts', time, msg.guild!.id, `expire ${time} ${text!} #${channel.name}`, message.id, channel.id, msg.guild!.id); |
const timeout = await setTimeoutv2('expire', time, msg.guild!.id, `expire ${time} ${text!} #${channel.name}`, message.id, channel.id, msg.guild!.id); |
81 |
|
|
82 |
await msg.reply({ |
await msg.reply({ |
83 |
embeds: [ |
embeds: [ |