File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,23 @@ export const slackMessageReaderTool: ToolConfig<
8888 transformResponse : async ( response : Response ) => {
8989 const data = await response . json ( )
9090
91+ if ( ! data . ok ) {
92+ if ( data . error === 'not_in_channel' ) {
93+ throw new Error (
94+ 'Bot is not in the channel. Please invite the Sim bot to your Slack channel by typing: /invite @Sim Studio'
95+ )
96+ }
97+ if ( data . error === 'channel_not_found' ) {
98+ throw new Error ( 'Channel not found. Please check the channel ID and try again.' )
99+ }
100+ if ( data . error === 'missing_scope' ) {
101+ throw new Error (
102+ 'Missing required permissions. Please reconnect your Slack account with the necessary scopes (channels:history, groups:history).'
103+ )
104+ }
105+ throw new Error ( data . error || 'Failed to fetch messages from Slack' )
106+ }
107+
91108 const messages = ( data . messages || [ ] ) . map ( ( message : any ) => ( {
92109 // Core properties
93110 type : message . type || 'message' ,
You can’t perform that action at this time.
0 commit comments