mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Prettified Code!
This commit is contained in:
@@ -26,6 +26,6 @@ export async function addToThread(channelId: bigint, userId?: bigint) {
|
||||
"put",
|
||||
userId
|
||||
? endpoints.THREAD_USER(channelId, userId)
|
||||
: endpoints.THREAD_ME(channelId),
|
||||
: endpoints.THREAD_ME(channelId)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,5 @@ import { endpoints } from "../../../util/constants.ts";
|
||||
export async function getActiveThreads(channelId: bigint) {
|
||||
// TODO(threads): perm check
|
||||
// TODO(threads): test if it works
|
||||
return await rest.runMethod(
|
||||
"get",
|
||||
endpoints.THREAD_ACTIVE(channelId),
|
||||
);
|
||||
return await rest.runMethod("get", endpoints.THREAD_ACTIVE(channelId));
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export async function getArchivedThreads(
|
||||
channelId: bigint,
|
||||
options?: ListPublicArchivedThreads & {
|
||||
type?: "public" | "private" | "privateJoinedThreads";
|
||||
},
|
||||
}
|
||||
) {
|
||||
// TODO(threads): perm check
|
||||
// TODO(threads): check if this works
|
||||
@@ -19,6 +19,6 @@ export async function getArchivedThreads(
|
||||
: options?.type === "private"
|
||||
? endpoints.THREAD_ARCHIVED_PRIVATE(channelId)
|
||||
: endpoints.THREAD_ARCHIVED_PUBLIC(channelId),
|
||||
snakelize(options ?? {}),
|
||||
snakelize(options ?? {})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,6 @@ export async function removeFromThread(channelId: bigint, userId?: bigint) {
|
||||
"delete",
|
||||
userId
|
||||
? endpoints.THREAD_USER(channelId, userId)
|
||||
: endpoints.THREAD_ME(channelId),
|
||||
: endpoints.THREAD_ME(channelId)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { snakelize } from "../../../util/utils.ts";
|
||||
*/
|
||||
export async function startThread(
|
||||
channelId: bigint,
|
||||
options: StartThread & { messageId?: bigint },
|
||||
options: StartThread & { messageId?: bigint }
|
||||
) {
|
||||
const channel = await cacheHandlers.get("channels", channelId);
|
||||
if (channel) {
|
||||
@@ -33,6 +33,6 @@ export async function startThread(
|
||||
options?.messageId
|
||||
? endpoints.THREAD_START_PUBLIC(channelId, options.messageId)
|
||||
: endpoints.THREAD_START_PRIVATE(channelId),
|
||||
snakelize(options),
|
||||
snakelize(options)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user