Skip to content

Commit

Permalink
📈 Only send suspicious bot alert if risk level is below 100
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Dec 11, 2023
1 parent 619a548 commit eedb714
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/builder/src/features/typebot/api/publishTypebot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ export const publishTypebot = authenticatedProcedure
})

if (riskLevel > 0 && riskLevel !== existingTypebot.riskLevel) {
if (env.MESSAGE_WEBHOOK_URL)
if (env.MESSAGE_WEBHOOK_URL && riskLevel !== 100)
await fetch(env.MESSAGE_WEBHOOK_URL, {
method: 'POST',
body: `🚨 *Radar detected a potential malicious typebot* 🚨\n\n*Typebot:* ${existingTypebot.name}\n*Risk level:* ${riskLevel}/100\n*Typebot ID:* ${existingTypebot.id}\n*Workspace ID:* ${existingTypebot.workspaceId}\n*User ID:* ${user.id}`,
body: `⚠️ Suspicious typebot to be reviewed: ${existingTypebot.name} (${env.NEXTAUTH_URL}/typebots/${existingTypebot.id}/edit) (workspace: ${existingTypebot.workspaceId})`,
}).catch((err) => {
console.error('Failed to send message', err)
})
Expand Down

1 comment on commit eedb714

@vercel
Copy link

@vercel vercel bot commented on eedb714 Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

Please sign in to comment.