Skip to content

Commit

Permalink
Only support one mention
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric committed Oct 5, 2023
1 parent 7578520 commit 47ee484
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion connectors/src/connectors/slack/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,13 @@ async function botAnswerMessage(
const mentionCandidates = message.match(/~[a-zA-Z0-9_-]{1,20}/g) || [];

let mentions: { assistantName: string; assistantId: string }[] = [];
if (mentionCandidates.length > 0) {
if (mentionCandidates.length > 1) {
return new Err(
new SlackExternalUserError(
"Only one assistant at a time can be called through Slack."
)
);
} else if (mentionCandidates.length === 1) {
const agentConfigurationsRes = await dustAPI.getAgentConfigurations();
if (agentConfigurationsRes.isErr()) {
return new Err(new Error(agentConfigurationsRes.error.message));
Expand Down

0 comments on commit 47ee484

Please sign in to comment.