Files
discordeno/plugins/permissions/src/channels/threads/joinThread.ts
2022-01-26 19:02:34 +01:00

16 lines
407 B
TypeScript

import { BotWithCache } from "../../../deps.ts";
export default function joinThread(bot: BotWithCache) {
const joinThreadOld = bot.helpers.joinThread;
bot.helpers.joinThread = function (threadId) {
const channel = bot.channels.get(threadId);
if (channel && !channel.archived) {
throw new Error("You can not join an archived channel.");
}
return joinThreadOld(threadId);
};
}