1 |
import { TextChannel } from "discord.js"; |
2 |
import DiscordClient from "../client/Client"; |
3 |
|
4 |
export default async function expire(client: DiscordClient, message_id: string, channel_id: string, guild_id: string) { |
5 |
console.log(channel_id, guild_id); |
6 |
const guild = await client.guilds.cache.get(guild_id); |
7 |
|
8 |
if (guild) { |
9 |
const channel = await guild.channels.fetch(channel_id); |
10 |
|
11 |
if (channel) { |
12 |
const message = await (channel as TextChannel).messages.fetch(message_id); |
13 |
|
14 |
if (message) { |
15 |
await message.delete(); |
16 |
} |
17 |
} |
18 |
} |
19 |
} |