Commit 708fda5
committed
Discord: fix /codex_resume identity resolution in brand-new threads
In brand-new Discord threads, the slash interaction can set ctx.from to the
slash user identity (e.g. "slash:user-id") while the real channel target is
in ctx.to. The previous ctx.from ?? ctx.to expression normalized a slash
identity to undefined, causing toConversationTargetFromCommand() to return
null and /cas_resume to fail on the first attempt.
Fix: when ctx.from starts with "slash:", use ctx.to as the channel source
instead. The existing behavior for established channels (ctx.from holds the
channel identity) is unchanged.
Adds a regression test covering the brand-new-thread scenario.
Fixes #301 parent 97e3084 commit 708fda5
2 files changed
+33
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
323 | 350 | | |
324 | 351 | | |
325 | 352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
275 | 280 | | |
276 | 281 | | |
277 | 282 | | |
| |||
0 commit comments