Skip to content

Commit 7cdd5e8

Browse files
committed
Fix message sending and improve message copy
1 parent b22266b commit 7cdd5e8

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

integrations/slack/src/actions/ingestConversation.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function ingestSlackConversation(params: IngestSlackConversationAct
3333
return parseSlackConversationPermalink(params.text);
3434
} catch (error) {
3535
logger.debug(
36-
'Error when parsing the link of the conversation to ingest',
36+
`⚠️ We couldn’t understand that link. Please check it and try again.`,
3737
error,
3838
);
3939
}
@@ -48,11 +48,9 @@ export async function ingestSlackConversation(params: IngestSlackConversationAct
4848
{
4949
method: 'POST',
5050
path: 'chat.postMessage',
51-
responseUrl: responseUrl,
5251
payload: {
5352
channel: channelId,
54-
text: `_Unable to retrieve the details of the conversation_`,
55-
...(userId ? { user: userId } : {}),
53+
text: `⚠️ We couldn’t get the conversation details. Please try again.`,
5654
},
5755
},
5856
{
@@ -64,25 +62,21 @@ export async function ingestSlackConversation(params: IngestSlackConversationAct
6462
}
6563

6664
await Promise.all([
67-
// acknowledge the ingest command back to the user
6865
slackAPI(
6966
context,
7067
{
7168
method: 'POST',
72-
path: 'chat.postEphemeral',
73-
responseUrl,
69+
path: 'chat.postMessage',
7470
payload: {
7571
channel: channelId,
76-
text: 'Sending this conversation to Docs Agent to improve your documentation...',
77-
...(userId ? { user: userId } : {}),
78-
...(threadId ? { thread_ts: threadId } : {}),
72+
text: '🚀 Sharing this conversation with Docs Agent to improve your docs...',
73+
thread_ts: threadId,
7974
},
8075
},
8176
{
8277
accessToken,
8378
},
8479
),
85-
// Queue a task to ingest the conversation asynchronously.
8680
queueIngestSlackConversationTask({
8781
channelId,
8882
channelName,
@@ -173,12 +167,10 @@ export async function handleIngestSlackConversationTask(
173167
{
174168
method: 'POST',
175169
path: 'chat.postMessage',
176-
responseUrl,
177170
payload: {
178171
channel: channelId,
179-
text: '🤖 This conversation has been sent to Docs Agents',
180-
...(userId ? { user: userId } : {}),
181-
...(threadId ? { thread_ts: threadId } : {}),
172+
text: `🤖 Got it! Docs Agent is on it. We'll analyze this and suggest changes if needed.`,
173+
thread_ts: threadId,
182174
},
183175
},
184176
{
@@ -191,12 +183,10 @@ export async function handleIngestSlackConversationTask(
191183
{
192184
method: 'POST',
193185
path: 'chat.postMessage',
194-
responseUrl,
195186
payload: {
196187
channel: channelId,
197-
text: '_An error occured whilst ingesting the converation_',
198-
...(userId ? { user: userId } : {}),
199-
...(threadId ? { thread_ts: threadId } : {}),
188+
text: `⚠️ Something went wrong while sending this conversation to Docs Agent.`,
189+
thread_ts: threadId,
200190
},
201191
},
202192
{

0 commit comments

Comments
 (0)