mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:18:25 +00:00
chore: Fix TypeScript errors 1/n.
This commit is contained in:
@@ -83,7 +83,11 @@ async function listGuildChannels(
|
||||
fetcher: typeof fetch,
|
||||
guildId: string,
|
||||
): Promise<DiscordChannelSummary[]> {
|
||||
const raw = await fetchDiscord(`/guilds/${guildId}/channels`, token, fetcher);
|
||||
const raw = await fetchDiscord<Array<DiscordChannelSummary>>(
|
||||
`/guilds/${guildId}/channels`,
|
||||
token,
|
||||
fetcher,
|
||||
);
|
||||
return raw
|
||||
.filter((channel) => Boolean(channel.id) && "name" in channel)
|
||||
.map((channel) => {
|
||||
@@ -107,7 +111,11 @@ async function fetchChannel(
|
||||
fetcher: typeof fetch,
|
||||
channelId: string,
|
||||
): Promise<DiscordChannelSummary | null> {
|
||||
const raw = await fetchDiscord(`/channels/${channelId}`, token, fetcher);
|
||||
const raw = await fetchDiscord<DiscordChannelSummary & { guild_id: string }>(
|
||||
`/channels/${channelId}`,
|
||||
token,
|
||||
fetcher,
|
||||
);
|
||||
if (!raw || !("guild_id" in raw)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user