From 0052a29e32c85be0a5253c6484473ace1a500885 Mon Sep 17 00:00:00 2001 From: ITOH Date: Fri, 21 May 2021 16:39:57 +0200 Subject: [PATCH 1/5] fix(types): message.stickers is an array --- src/types/messages/message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/messages/message.ts b/src/types/messages/message.ts index f377353d5..8478757a4 100644 --- a/src/types/messages/message.ts +++ b/src/types/messages/message.ts @@ -79,7 +79,7 @@ export interface Message { /** Message flags combined as a bitfield */ flags?: number; /** The stickers sent with the message (bots currently can only receive messages with stickers, not send) */ - stickers?: MessageSticker; + stickers?: MessageSticker[]; /** * The message associated with the `message_reference` * Note: This field is only returned for messages with a `type` of `19` (REPLY). If the message is a reply but the `referenced_message` field is not present, the backend did not attempt to fetch the message that was being replied to, so its state is unknown. If the field exists but is null, the referenced message was deleted. From e712462e2985062a872f9a6f2161ad9a6e4d8134 Mon Sep 17 00:00:00 2001 From: ITOH Date: Fri, 21 May 2021 16:43:31 +0200 Subject: [PATCH 2/5] change: CreateGuildChannel.parentId should use bigint --- src/types/guilds/create_guild_channel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/guilds/create_guild_channel.ts b/src/types/guilds/create_guild_channel.ts index 38eb79102..9bbc4e93e 100644 --- a/src/types/guilds/create_guild_channel.ts +++ b/src/types/guilds/create_guild_channel.ts @@ -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; } From e738d8a85a77eaf1f26020a1e4d0c7d931c5af6c Mon Sep 17 00:00:00 2001 From: ITOH Date: Fri, 21 May 2021 16:43:56 +0200 Subject: [PATCH 3/5] fix: createChannel parentId is now a bigint --- src/helpers/channels/clone_channel.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/helpers/channels/clone_channel.ts b/src/helpers/channels/clone_channel.ts index 1a8c4cc5b..f8c0ed0b0 100644 --- a/src/helpers/channels/clone_channel.ts +++ b/src/helpers/channels/clone_channel.ts @@ -23,9 +23,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, ) => ({ From a0cc5a558fafd867fe035f2fd71244d237263358 Mon Sep 17 00:00:00 2001 From: ITOH Date: Fri, 21 May 2021 16:45:09 +0200 Subject: [PATCH 4/5] change: createChannelOptions.parentId is now a bigint --- tests/channels/category_children.ts | 3 +-- tests/channels/is_channel_synced.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/channels/category_children.ts b/tests/channels/category_children.ts index a649e066f..78901d894 100644 --- a/tests/channels/category_children.ts +++ b/tests/channels/category_children.ts @@ -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, }) ), ); diff --git a/tests/channels/is_channel_synced.ts b/tests/channels/is_channel_synced.ts index 6a4d96db7..aca9f31d0 100644 --- a/tests/channels/is_channel_synced.ts +++ b/tests/channels/is_channel_synced.ts @@ -39,7 +39,7 @@ Deno.test({ const channel = await createChannel(tempData.guildId, { name: "synced-channel", - parentId: category.id.toString(), + parentId: category.id, }); // Assertions From c80176c7fbbad607683f38a0d7bd18e63c6475c1 Mon Sep 17 00:00:00 2001 From: ITOH Date: Fri, 21 May 2021 16:47:48 +0200 Subject: [PATCH 5/5] remove: unused import --- src/helpers/channels/clone_channel.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/helpers/channels/clone_channel.ts b/src/helpers/channels/clone_channel.ts index f8c0ed0b0..8ea8a5ecb 100644 --- a/src/helpers/channels/clone_channel.ts +++ b/src/helpers/channels/clone_channel.ts @@ -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";