Update get_pins.ts

This commit is contained in:
ITOH
2021-04-23 23:27:39 +02:00
parent 7f84762176
commit 3812025506

View File

@@ -1,14 +1,14 @@
import { rest } from "../../rest/rest.ts";
import { structures } from "../../structures/mod.ts";
import { DiscordMessage } from "../../types/messages/message.ts";
import { Message } from "../../types/messages/message.ts";
import { endpoints } from "../../util/constants.ts";
/** Get pinned messages in this channel. */
export async function getPins(channelId: string) {
const result = (await rest.runMethod(
const result = await rest.runMethod<Message[]>(
"get",
endpoints.CHANNEL_PINS(channelId),
)) as DiscordMessage[];
);
return Promise.all(
result.map((res) => structures.createDiscordenoMessage(res)),