This commit is contained in:
ITOH
2020-12-09 16:50:20 +01:00
parent af2a398318
commit 88730266ff
+6 -6
View File
@@ -440,15 +440,15 @@ export async function editChannelOverwrite(
const { allow, deny, ...info } = overwrite; const { allow, deny, ...info } = overwrite;
let channel = cache.channels.get(channelID); let channel = cache.channels.get(channelID);
if (!channel) return Errors.CHANNEL_NOT_FOUND; if (!channel) throw new Error(Errors.CHANNEL_NOT_FOUND);
const payload = { const payload = {
permission_overwrites: [ permission_overwrites: [
...(channel?.permissionOverwrites || []).map((ro) => ({ ...(channel?.permissionOverwrites || []).map((rawOverwrite) => ({
id: ro.id, id: rawOverwrite.id,
type: ro.type, type: rawOverwrite.type,
allow: ro.allow, allow: rawOverwrite.allow,
deny: ro.deny, deny: rawOverwrite.deny,
})), })),
{ {
...info, ...info,