change(startThread): make messageId a seperate argument

This commit is contained in:
ITOH
2021-06-19 19:08:45 +02:00
parent d75e0549d7
commit 977e7e5ca6
2 changed files with 3 additions and 7 deletions

View File

@@ -9,7 +9,7 @@ import { channelToThread } from "../../../util/transformers/channel_to_thread.ts
import { snakelize } from "../../../util/utils.ts";
/** Creates a new public thread from an existing message. Returns a thread channel. */
export async function startThread(channelId: bigint, options: StartThread & { messageId: bigint }) {
export async function startThread(channelId: bigint, messageId: bigint, options: StartThread) {
const channel = await cacheHandlers.get("channels", channelId);
if (channel) {
if (!channel.isGuildTextBasedChannel) {
@@ -20,10 +20,6 @@ export async function startThread(channelId: bigint, options: StartThread & { me
}
return channelToThread(
await rest.runMethod<Channel>(
"post",
endpoints.THREAD_START_PUBLIC(channelId, options.messageId),
snakelize(options)
)
await rest.runMethod<Channel>("post", endpoints.THREAD_START_PUBLIC(channelId, messageId), snakelize(options))
);
}

View File

@@ -1,3 +1,3 @@
export * from "./channel_to_thread.ts";
export * from "./thread_member_modified.ts";
export * from "./thread_members_update_modified.ts"
export * from "./thread_members_update_modified.ts";