Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/slack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blink-sdk/slack",
"version": "1.2.1",
"version": "1.2.2",
"author": {
"name": "Coder",
"email": "support@blink.so",
Expand Down
25 changes: 18 additions & 7 deletions packages/slack/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,12 @@ export const extractMessagesMetadata = async <
for (const channelId of channelIds) {
channelPromises[channelId] = client.conversations
.info({ channel: channelId })
.then((res) => res.channel);
.then((res) => {
if (!res.ok) {
throw new Error(`Failed to get channel info: ${res.error}`);
}
return res.channel;
});
}

// Fetch team info
Expand All @@ -591,9 +596,12 @@ export const extractMessagesMetadata = async <
Promise<TeamInfoResponse["team"] | undefined>
> = {};
for (const teamId of teamIds) {
teamPromises[teamId] = client.team
.info({ team: teamId })
.then((res) => res.team);
teamPromises[teamId] = client.team.info({ team: teamId }).then((res) => {
if (!res.ok) {
throw new Error(`Failed to get team info: ${res.error}`);
}
return res.team;
});
}

// Fetch user info
Expand All @@ -602,9 +610,12 @@ export const extractMessagesMetadata = async <
Promise<UsersInfoResponse["user"] | undefined>
> = {};
for (const userId of userIds) {
userPromises[userId] = client.users
.info({ user: userId })
.then((res) => res.user);
userPromises[userId] = client.users.info({ user: userId }).then((res) => {
if (!res.ok) {
throw new Error(`Failed to get user info: ${res.error}`);
}
return res.user;
});
}

// Fetch files
Expand Down
Loading