mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
fix: category children (#800)
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
|
||||
/** Gets an array of all the channels ids that are the children of this category. */
|
||||
export function categoryChildrenIds(guildId: string, id: string) {
|
||||
export function categoryChildren(id: string) {
|
||||
return cacheHandlers.filter(
|
||||
"channels",
|
||||
(channel) => channel.parentId === id && channel.guildId === guildId,
|
||||
(channel) => channel.parentId === id
|
||||
);
|
||||
}
|
||||
@@ -3,14 +3,13 @@ import { cacheHandlers } from "../../cache.ts";
|
||||
import { rest } from "../../rest/rest.ts";
|
||||
import { structures } from "../../structures/mod.ts";
|
||||
import { DiscordChannel } from "../../types/channels/channel.ts";
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import { CreateGuildChannel } from "../../types/guilds/create_guild_channel.ts";
|
||||
import { PermissionStrings } from "../../types/permissions/permission_strings.ts";
|
||||
import { endpoints } from "../../util/constants.ts";
|
||||
import {
|
||||
calculateBits,
|
||||
requireBotGuildPermissions,
|
||||
} from "../../util/permissions.ts";
|
||||
import { camelKeysToSnakeCase } from "../../util/utils.ts";
|
||||
|
||||
/** Create a channel in your server. Bot needs MANAGE_CHANNEL permissions in the server. */
|
||||
export async function createChannel(
|
||||
@@ -34,7 +33,7 @@ export async function createChannel(
|
||||
"post",
|
||||
endpoints.GUILD_CHANNELS(guildId),
|
||||
{
|
||||
...options,
|
||||
...camelKeysToSnakeCase(options),
|
||||
permission_overwrites: options?.permissionOverwrites?.map((perm) => ({
|
||||
...perm,
|
||||
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
import { categoryChildrenIds } from "./channels/category_children_ids.ts";
|
||||
import { categoryChildren } from "./channels/category_children.ts";
|
||||
import { channelOverwriteHasPermission } from "./channels/channel_overwrite_has_permission.ts";
|
||||
import { createChannel } from "./channels/create_channel.ts";
|
||||
import { deleteChannel } from "./channels/delete_channel.ts";
|
||||
@@ -123,7 +123,7 @@ export {
|
||||
avatarURL,
|
||||
ban,
|
||||
banMember,
|
||||
categoryChildrenIds,
|
||||
categoryChildren,
|
||||
channelOverwriteHasPermission,
|
||||
createChannel,
|
||||
createEmoji,
|
||||
@@ -274,7 +274,7 @@ export let helpers = {
|
||||
getEmoji,
|
||||
getEmojis,
|
||||
// guilds
|
||||
categoryChildrenIds,
|
||||
categoryChildren,
|
||||
createGuild,
|
||||
deleteServer,
|
||||
editGuild,
|
||||
|
||||
Reference in New Issue
Block a user