mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
add: return type
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { cacheHandlers } from "../../../cache.ts";
|
||||
import { rest } from "../../../rest/rest.ts";
|
||||
import { Channel } from "../../../types/channels/channel.ts";
|
||||
import { StartThread } from "../../../types/channels/threads/start_thread.ts";
|
||||
import { Errors } from "../../../types/discordeno/errors.ts";
|
||||
import { endpoints } from "../../../util/constants.ts";
|
||||
import { requireBotChannelPermissions } from "../../../util/permissions.ts";
|
||||
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. */
|
||||
@@ -17,9 +19,11 @@ export async function startThread(channelId: bigint, options: StartThread & { me
|
||||
await requireBotChannelPermissions(channel, ["SEND_MESSAGES", "USE_PUBLIC_THREADS"]);
|
||||
}
|
||||
|
||||
return await rest.runMethod(
|
||||
"post",
|
||||
endpoints.THREAD_START_PUBLIC(channelId, options.messageId),
|
||||
snakelize(options)
|
||||
return channelToThread(
|
||||
await rest.runMethod<Channel>(
|
||||
"post",
|
||||
endpoints.THREAD_START_PUBLIC(channelId, options.messageId),
|
||||
snakelize(options)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user