fix(readme): correct OAuth permissions integer for thread + attachment usage#24
fix(readme): correct OAuth permissions integer for thread + attachment usage#24
Conversation
…t usage The documented invite URL granted Manage Messages but no thread permissions, despite the bot creating threads (`messageCreate.ts:75`, `session.ts:99`) and re-uploading attachments to them (`messageCreate.ts:96`). Existing installs work today only because most servers grant Create Public Threads / Send Messages in Threads / Attach Files to @everyone by default; on a server that has revoked any of those, the bot's `/session new` and mention-triggered thread flow would fail at install time. Permission integer: 11344 → 309237681232 Add: - Attach Files (32768) — for re-uploading attachments to threads - Create Public Threads (34359738368) — for `/session new` and mention-triggered threads - Send Messages in Threads (274877906944) Drop: - Manage Messages (8192) — no code path requires it. PR #22 replaced the only caller (`reaction.remove()`) with `reaction.users.remove()`, which only needs Add Reactions. Also adds a one-line rationale next to each granted permission so future readers can audit the set against the code that uses it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
README-only change. Does not affect code or tests, but does require existing installs to re-invite the bot if a server has revoked thread/attachment permissions for
@everyone(which is why this bug has been latent).The bug
The documented invite URL granted
Manage Messagesbut no thread permissions, even though the bot creates and sends to threads:src/handlers/messageCreate.ts:75—(message.channel as TextChannel).threads.create(...)for mention-triggered threadssrc/commands/session.ts:99—parentChannel.threads.create(...)for/session newsrc/handlers/messageCreate.ts:96—thread.send({ files: [...] })to re-upload attachmentsToday the bot works on most Discord servers because
Create Public Threads,Send Messages in Threads, andAttach Filesare granted to@everyoneby default. A server that has revoked any of those for@everyonewould break the bot's/session newand mention flow on a fresh install.The fix
Permission integer:
11344→309237681232reaction.remove()withreaction.users.remove()/session new+ mention-triggered threadsTotal:
16 + 64 + 1024 + 2048 + 32768 + 34359738368 + 274877906944 = 309237681232Also adds a one-line rationale next to each granted permission so future readers can audit the set against the code paths that use it.
Test plan
grepconfirms no in-tree usage ofMANAGE_MESSAGES,messages.delete,reactions.removeAll,pin,unpin.grepconfirmsthreads.createis called andthread.send({ files })is called./session newand post an attachment, verify both succeed.🤖 Generated with Claude Code