This repository was archived by the owner on Feb 21, 2026. It is now read-only.
Commit 63c53c8
feat: auto-respond in bot-created Discord threads (#144)
* feat: auto-respond in bot-created Discord threads (#77)
Messages sent in Discord threads created by this bot now trigger the
agent automatically — no @mention required, same as DMs.
**Changes to handleMessage:**
- Detect thread messages via `message.channel.isThread()`
- For threads, resolve the parent channel JID for group lookup (threads
aren't registered groups, but their parent channels are)
- Bot filter block updated to also use parent channel JID for threads
(preserves per-group trigger patterns for agent-to-agent comms)
- Auto-trigger logic: if `message.channel.ownerId === botId`, prepend
trigger and thread context (`[In thread: <name>]`) to the message
- Responses currently go to the parent channel; full in-thread reply
routing can be added in a follow-up PR
**Not changed:**
- Thread registration: no new DB entries needed
- Message storage: thread messages stored under parent channel JID
- Reactions and other Discord events: unaffected
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(discord): address CodeRabbit review issues in PR #144
- Use per-group trigger name/pattern for auto-trigger in bot threads
(fixes multi-agent setups where group trigger differs from ASSISTANT_NAME)
- Check original content before prepending thread context to avoid
potential double trigger prefix edge case
- Fix mentionsOtherUsersOnly TS2345 error: add botId != null guard
so Map.has() receives string (not string | undefined)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e8110e3 commit 63c53c8
1 file changed
Lines changed: 31 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
446 | 454 | | |
447 | 455 | | |
448 | 456 | | |
| 457 | + | |
449 | 458 | | |
450 | | - | |
451 | | - | |
| 459 | + | |
452 | 460 | | |
453 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
454 | 464 | | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
458 | 468 | | |
459 | | - | |
460 | 469 | | |
461 | 470 | | |
462 | 471 | | |
| |||
498 | 507 | | |
499 | 508 | | |
500 | 509 | | |
| 510 | + | |
| 511 | + | |
501 | 512 | | |
502 | 513 | | |
503 | | - | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
504 | 517 | | |
505 | 518 | | |
506 | 519 | | |
| |||
631 | 644 | | |
632 | 645 | | |
633 | 646 | | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
634 | 660 | | |
635 | 661 | | |
636 | 662 | | |
| |||
0 commit comments