fix: getChannelInivtes return type

This commit is contained in:
ITOH
2021-05-22 17:58:17 +02:00
parent 97e37da29a
commit 2850fdd13f

View File

@@ -1,5 +1,5 @@
import { rest } from "../../rest/rest.ts";
import type { Invite } from "../../types/invites/invite.ts";
import type { InviteMetadata } from "../../types/invites/invite_metadata.ts";
import { Collection } from "../../util/collection.ts";
import { endpoints } from "../../util/constants.ts";
import { requireBotChannelPermissions } from "../../util/permissions.ts";
@@ -8,7 +8,7 @@ import { requireBotChannelPermissions } from "../../util/permissions.ts";
export async function getChannelInvites(channelId: bigint) {
await requireBotChannelPermissions(channelId, ["MANAGE_CHANNELS"]);
const result = await rest.runMethod<Invite[]>("get", endpoints.CHANNEL_INVITES(channelId));
const result = await rest.runMethod<InviteMetadata[]>("get", endpoints.CHANNEL_INVITES(channelId));
return new Collection(result.map((invite) => [invite.code, invite]));
}