Skip to content

feat(discord): add proxy support and tests#853

Merged
alexhoshina merged 3 commits intosipeed:mainfrom
nayihz:feat_discord_proxy
Mar 3, 2026
Merged

feat(discord): add proxy support and tests#853
alexhoshina merged 3 commits intosipeed:mainfrom
nayihz:feat_discord_proxy

Conversation

@nayihz
Copy link
Contributor

@nayihz nayihz commented Feb 27, 2026

📝 Description

Add Discord proxy support for both REST and websocket paths, with coverage tests. This ensures Discord can work in proxied environments when a channel proxy is configured (including socks5://) and improves behavior around proxy setup validation.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

🔗 Related Issue

N/A

📚 Technical Context (Skip for Docs)

  • Reference URL: N/A
  • Reasoning: Route Discord HTTP client and websocket dialer through configured proxy logic, and add tests to prevent regressions.

🧪 Test Environment

  • Hardware: PC
  • OS: macOS
  • Model/Provider: N/A
  • Channels: Discord

📸 Evidence (Optional)

Click to view Logs/Screenshots

Added pkg/channels/discord_test.go and validated proxy setup behavior via unit tests.

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@nayihz
Copy link
Contributor Author

nayihz commented Mar 2, 2026

@alexhoshina Could you help review this PR? Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be moved to pkg/channels/discord/discord_test.go


transport := &http.Transport{Proxy: proxyFunc}
session.Client = &http.Client{
Timeout: 20 * time.Second,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Perhaps the hardcoded values could be extracted as constants or configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: channel labels Mar 3, 2026
@nayihz nayihz force-pushed the feat_discord_proxy branch from fea9433 to 76bdab9 Compare March 3, 2026 07:05
@nayihz nayihz requested a review from alexhoshina March 3, 2026 07:56
Copy link
Collaborator

@alexhoshina alexhoshina left a comment

Choose a reason for hiding this comment

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

LGTM

@nayihz nayihz force-pushed the feat_discord_proxy branch 2 times, most recently from dd0013d to c7a5881 Compare March 3, 2026 10:06
@nayihz nayihz force-pushed the feat_discord_proxy branch from c7a5881 to 69b1ae4 Compare March 3, 2026 10:39
@alexhoshina alexhoshina merged commit bea238c into sipeed:main Mar 3, 2026
2 checks passed
hyperwd pushed a commit to hyperwd/picoclaw that referenced this pull request Mar 5, 2026
feat(discord): add proxy support and tests
Pluckypan pushed a commit to Pluckypan/picoclaw that referenced this pull request Mar 6, 2026
feat(discord): add proxy support and tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants