Skip to content

Commit

Permalink
Bot handler return OK() (#1717)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric authored Sep 22, 2023
1 parent 493bdba commit 6fa6dd0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions connectors/src/connectors/slack/bot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {
ChatSessionUpdateEvent,
AgentGenerationSuccessEvent,
DustAPI,
PostMessagesRequestBodySchema,
} from "@connectors/lib/dust_api";
Expand Down Expand Up @@ -27,7 +27,7 @@ export async function botAnswerMessageWithErrorHandling(
slackChannel: string,
slackUserId: string,
slackMessageTs: string
): Promise<Result<ChatSessionUpdateEvent, Error>> {
): Promise<Result<AgentGenerationSuccessEvent, Error>> {
const slackConfig = await SlackConfiguration.findOne({
where: {
slackTeamId: slackTeamId,
Expand Down Expand Up @@ -100,7 +100,7 @@ async function botAnswerMessage(
slackUserId: string,
slackMessageTs: string,
connector: Connector
): Promise<Result<ChatSessionUpdateEvent, Error>> {
): Promise<Result<AgentGenerationSuccessEvent, Error>> {
const { DUST_API = "https://dust.tt" } = process.env;

const slackChatBotMessage = await SlackChatBotMessage.create({
Expand Down Expand Up @@ -254,6 +254,7 @@ async function botAnswerMessage(
ts: mainMessage.ts as string,
thread_ts: slackMessageTs,
});
return new Ok(event);
break;
}
default:
Expand Down

0 comments on commit 6fa6dd0

Please sign in to comment.