mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
fix: thread.channelId -> thread.parentId
This commit is contained in:
@@ -14,7 +14,7 @@ export async function addToThread(threadId: bigint, userId: bigint) {
|
||||
}
|
||||
|
||||
// If a user id is provided SEND_MESSAGES is required.
|
||||
const channel = await cacheHandlers.get("channels", thread.channelId);
|
||||
const channel = await cacheHandlers.get("channels", thread.parentId);
|
||||
// TODO: does MANAGE_THREADS override this????
|
||||
if (channel) await requireBotChannelPermissions(channel, ["SEND_MESSAGES"]);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { requireBotGuildPermissions } from "../../../util/permissions.ts";
|
||||
export async function deleteThread(threadId: bigint, reason?: string) {
|
||||
const thread = await cacheHandlers.get("threads", threadId);
|
||||
if (thread) {
|
||||
const channel = await cacheHandlers.get("channels", thread?.channelId);
|
||||
const channel = await cacheHandlers.get("channels", thread?.parentId);
|
||||
if (channel?.guildId) await requireBotGuildPermissions(channel.guildId, ["MANAGE_THREADS"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export async function getThreadMembers(threadId: bigint) {
|
||||
|
||||
const thread = await cacheHandlers.get("threads", threadId);
|
||||
if (thread?.isPrivate) {
|
||||
const channel = await cacheHandlers.get("channels", thread.channelId);
|
||||
const channel = await cacheHandlers.get("channels", thread.parentId);
|
||||
if (channel && !(await botHasChannelPermissions(channel, ["MANAGE_THREADS"])) && !thread.botIsMember)
|
||||
throw new Error(Errors.CANNOT_GET_MEMBERS_OF_AN_UNJOINED_PRIVATE_THREAD);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export async function removeThreadMember(threadId: bigint, userId: bigint) {
|
||||
if (thread.archived) throw new Error(Errors.CANNOT_REMOVE_FROM_ARCHIVED_THREAD);
|
||||
|
||||
if (thread.ownerId !== botId) {
|
||||
const channel = await cacheHandlers.get("channels", thread.channelId);
|
||||
const channel = await cacheHandlers.get("channels", thread.parentId);
|
||||
if (channel) await requireBotChannelPermissions(channel, ["MANAGE_THREADS"]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user