Merge pull request #962 from discordeno/change-create-channel-parentId

change: CreateChannelOptions.parentId should use bigint
This commit is contained in:
Skillz4Killz
2021-05-21 10:52:21 -04:00
committed by GitHub
4 changed files with 3 additions and 8 deletions

View File

@@ -2,7 +2,6 @@ import { cacheHandlers } from "../../cache.ts";
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
import type { CreateGuildChannel } from "../../types/guilds/create_guild_channel.ts";
import { Errors } from "../../types/discordeno/errors.ts";
import { bigintToSnowflake } from "../../util/bigint.ts";
import { calculatePermissions } from "../../util/permissions.ts";
import { helpers } from "../mod.ts";
@@ -23,9 +22,6 @@ export async function cloneChannel(channelId: bigint, reason?: string) {
...channelToClone,
name: channelToClone.name!,
topic: channelToClone.topic || undefined,
parentId: channelToClone.parentId
? bigintToSnowflake(channelToClone.parentId)
: undefined,
permissionOverwrites: channelToClone.permissionOverwrites.map((
overwrite,
) => ({

View File

@@ -20,7 +20,7 @@ export interface CreateGuildChannel {
/** The channel's permission overwrites */
permissionOverwrites?: Overwrite[];
/** Id of the parent category for a channel */
parentId?: string;
parentId?: bigint;
/** Whether the channel is nsfw */
nsfw?: boolean;
}

View File

@@ -1,7 +1,6 @@
import { cache } from "../../src/cache.ts";
import { categoryChildren, createChannel } from "../../src/helpers/mod.ts";
import { DiscordChannelTypes } from "../../src/types/channels/channel_types.ts";
import { bigintToSnowflake } from "../../src/util/bigint.ts";
import { assertExists } from "../deps.ts";
import { delayUntil } from "../util/delay_until.ts";
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
@@ -30,7 +29,7 @@ Deno.test({
channelsToCreate.map((num) =>
createChannel(tempData.guildId, {
name: `Discordeno-test-${num}`,
parentId: bigintToSnowflake(category.id),
parentId: category.id,
})
),
);

View File

@@ -39,7 +39,7 @@ Deno.test({
const channel = await createChannel(tempData.guildId, {
name: "synced-channel",
parentId: category.id.toString(),
parentId: category.id,
});
// Assertions