mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 17:30:07 +00:00
14 lines
582 B
TypeScript
14 lines
582 B
TypeScript
import { BotWithCache } from "../../../deps.ts";
|
|
import { requireBotChannelPermissions } from "../../permissions.ts";
|
|
|
|
export function getPrivateArchivedThreads(bot: BotWithCache) {
|
|
const getPrivateArchivedThreadsOld = bot.helpers.getPrivateArchivedThreads;
|
|
bot.helpers.getPublicArchivedThreads = async function (channelId, options) {
|
|
const channel = bot.channels.get(channelId);
|
|
if (channel) {
|
|
requireBotChannelPermissions(bot, channel, ["READ_MESSAGE_HISTORY", "MANAGE_MESSAGES"]);
|
|
}
|
|
return await getPrivateArchivedThreadsOld(channelId, options);
|
|
};
|
|
}
|