mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10:07 +00:00
Update get_pins.ts
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user