Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add AI support bot for Discord #1267

Merged
merged 9 commits into from
Feb 13, 2025
Merged

feat: add AI support bot for Discord #1267

merged 9 commits into from
Feb 13, 2025

Conversation

drptbl
Copy link
Collaborator

@drptbl drptbl commented Feb 13, 2025

AI-Powered Discord Support Bot for Synpress

Overview

A Discord bot powered by Google's Gemini AI model that provides intelligent support for Synpress-related questions. The bot analyzes the entire Synpress codebase and responds to user queries with contextual, accurate information.

Key Features

AI Integration

  • Utilizes Google's Gemini 1.5 Pro model for intelligent responses
  • Processes the entire Synpress codebase for comprehensive knowledge
  • Maintains chat session context for coherent conversations

Usage

  1. Bot monitors the 'support-bot' channel
  2. Users mention the bot with their Synpress-related questions
  3. Bot processes the question and provides detailed responses
  4. Long responses are automatically split while maintaining formatting

This bot serves as an always-available support assistant, providing accurate, context-aware responses to Synpress-related queries while maintaining a user-friendly interaction model.

Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Signed-off-by: drptbl <jakub.mucha@icloud.com>
Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
synpress ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 0:30am

@drptbl drptbl merged commit 095454c into dev Feb 13, 2025
5 checks passed
@drptbl drptbl deleted the support-bot branch February 13, 2025 00:31
console.log('Workspace root:', workspaceRoot)
const flattenScript = path.join(workspaceRoot, 'flatten.cjs')
console.log('Flatten script path:', flattenScript)
await execAsync(`node ${flattenScript}`)

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

Copilot Autofix AI 3 days ago

To fix the problem, we should avoid constructing the shell command as a single string that the shell interprets. Instead, we can use execFileSync or execFile to pass the command and its arguments separately. This approach ensures that the arguments are not interpreted by the shell, thus preventing command injection vulnerabilities.

Specifically, we will:

  1. Replace the use of execAsync with execFileAsync.
  2. Pass the command (node) and its arguments (the script path) separately to execFileAsync.
Suggested changeset 1
support-bot/src/index.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/support-bot/src/index.ts b/support-bot/src/index.ts
--- a/support-bot/src/index.ts
+++ b/support-bot/src/index.ts
@@ -1,2 +1,2 @@
-import { exec } from 'child_process'
+import { execFile } from 'child_process'
 import { promises as fs } from 'fs'
@@ -8,3 +8,3 @@
 
-const execAsync = promisify(exec)
+const execFileAsync = promisify(execFile)
 
@@ -40,3 +40,3 @@
     console.log('Flatten script path:', flattenScript)
-    await execAsync(`node ${flattenScript}`)
+    await execFileAsync('node', [flattenScript])
 
EOF
@@ -1,2 +1,2 @@
import { exec } from 'child_process'
import { execFile } from 'child_process'
import { promises as fs } from 'fs'
@@ -8,3 +8,3 @@

const execAsync = promisify(exec)
const execFileAsync = promisify(execFile)

@@ -40,3 +40,3 @@
console.log('Flatten script path:', flattenScript)
await execAsync(`node ${flattenScript}`)
await execFileAsync('node', [flattenScript])

Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant