(happened through set reminders - the cronjobs were executed but never delivered via DM to me.)
Summary
Discord channel doesn't resolve usernames to user IDs when using the message tool or cron job delivery. Usernames like john.doe are incorrectly interpreted as channel names instead of being resolved to Discord user IDs.
Steps to reproduce
- Create a cron job with Discord delivery targeting a username:
json
{
"name": "Test Reminder",
"schedule": "0 8 * * *",
"text": "Hello!",
"deliver": true,
"channel": "discord",
"to": "john.doe"
}
2. Wait for the cron job to execute (or run it manually)
3. Observe that delivery fails silently with lastStatus: "error"
Expected behavior
Clawdbot should resolve the username john.doe to the Discord user ID (e.g., 987674328012545978) using the existing directory system (listDiscordDirectoryPeersLive), then deliver the message as a DM.
Actual behavior
The Discord outbound adapter has no resolveTarget hook. The parseDiscordTarget() function in /src/discord/targets.ts falls back to treating unrecognized strings as channel names:
typescript
// Line 56 in targets.ts
return buildMessagingTarget("channel", trimmed, trimmed);
So john.doe is passed as a channel name lookup, which fails because no channel named john.doe exists.
- Workaround: Use explicit
user:ID format: to: "user:987654321012345678"
Environment
- Clawdbot version: 1.0.34
- OS: Linux 6.8.0-90-generic (x64)
- Install method: pnpm (global)
Logs or screenshots
Cron job execution:
Name: "Test Reminder"
lastStatus: "error"
lastDurationMs: 10128
Flow trace:
- Cron executes with
to: "john.doe"
resolveOutboundTarget() looks for plugin.outbound?.resolveTarget → undefined for Discord
- Fallback:
to.trim() → "john.doe" passed unchanged
sendMessageDiscord() → parseDiscordTarget("john.doe")
- No match for
user:/channel:/@/#/numeric ID patterns
- Fallback line 56:
buildMessagingTarget("channel", "john.doe", "john.doe")
- Discord attempts to find channel
"john.doe" → fails
Suggested fix: Implement a resolveTarget hook for the Discord outbound adapter that uses the existing directory lookup to resolve usernames to user IDs.
(happened through set reminders - the cronjobs were executed but never delivered via DM to me.)
Summary
Discord channel doesn't resolve usernames to user IDs when using the
messagetool or cron job delivery. Usernames likejohn.doeare incorrectly interpreted as channel names instead of being resolved to Discord user IDs.Steps to reproduce
json
{
"name": "Test Reminder",
"schedule": "0 8 * * *",
"text": "Hello!",
"deliver": true,
"channel": "discord",
"to": "john.doe"
}
2. Wait for the cron job to execute (or run it manually)
3. Observe that delivery fails silently with
lastStatus: "error"Expected behavior
Clawdbot should resolve the username
john.doeto the Discord user ID (e.g.,987674328012545978) using the existing directory system (listDiscordDirectoryPeersLive), then deliver the message as a DM.Actual behavior
The Discord outbound adapter has no
resolveTargethook. TheparseDiscordTarget()function in/src/discord/targets.tsfalls back to treating unrecognized strings as channel names:typescript
// Line 56 in targets.ts
return buildMessagingTarget("channel", trimmed, trimmed);
So
john.doeis passed as a channel name lookup, which fails because no channel namedjohn.doeexists.user:IDformat:to: "user:987654321012345678"Environment
Logs or screenshots
Cron job execution:
Name: "Test Reminder"
lastStatus: "error"
lastDurationMs: 10128
Flow trace:
to: "john.doe"resolveOutboundTarget()looks forplugin.outbound?.resolveTarget→ undefined for Discordto.trim()→"john.doe"passed unchangedsendMessageDiscord()→parseDiscordTarget("john.doe")user:/channel:/@/#/numeric ID patternsbuildMessagingTarget("channel", "john.doe", "john.doe")"john.doe"→ failsSuggested fix: Implement a
resolveTargethook for the Discord outbound adapter that uses the existing directory lookup to resolve usernames to user IDs.