paperclipai/paperclip · error · Error
Discord bot needs View Channels, Send Messages, Create Publi
Error message
Discord bot needs View Channels, Send Messages, Create Public Threads, Send Messages in Threads, Read Message History, Add Reactions, Embed Links, and Attach Files in at least one text channel
What it means
After fetching channels and computing effective permissions (guild @everyone base permissions adjusted by role and member overwrites), listDiscordBotChannels filters text channels (type 0) where the bot holds all REQUIRED_CHANNEL_PERMISSIONS. If no channel satisfies the full permission set, there is nowhere the bot can post, so the function throws with the exact permission list needed.
Source
Thrown at server/src/services/chat-discord.ts:323
memberRoleIds,
roles,
});
return (
(permissions & REQUIRED_CHANNEL_PERMISSIONS) ===
REQUIRED_CHANNEL_PERMISSIONS
);
})
.sort((left, right) => (left.position ?? 0) - (right.position ?? 0))
.map((channel) => ({
providerResourceId: channel.id!,
parentProviderResourceId: guildId,
type: "channel",
label: channel.name ? `#${channel.name}` : channel.id!,
providerUrl: `https://discord.com/channels/${guildId}/${channel.id}`,
metadata: { source: "provider_inventory" },
}));
if (resources.length === 0) {
throw new Error(
"Discord bot needs View Channels, Send Messages, Create Public Threads, Send Messages in Threads, Read Message History, Add Reactions, Embed Links, and Attach Files in at least one text channel",
);
}
return { provider: "discord", resources };
}
View on GitHub (pinned to 01ad858492)
Solutions
- Re-invite the bot with the required permissions (View Channels, Send Messages, Create Public Threads, Send Messages in Threads, Read Message History, Add Reactions, Embed Links, Attach Files) via the OAuth2 URL with a permissions value covering those bits
- In Discord Server Settings, grant the bot's role these permissions on at least one text channel (channel-level overwrites are fine)
- Check per-channel permission overwrites that deny View Channels or Send Messages for the bot's role and remove/allow them
- Ensure at least one channel is a public text channel (type 0) the bot can see — the inventory only considers type-0 channels
Example fix
// before: default invite, no permissions requested https://discord.com/api/oauth2/authorize?client_id=...&scope=bot // after: request the needed permissions https://discord.com/api/oauth2/authorize?client_id=...&scope=bot&permissions=35803776 (ViewChannel|SendMessages|CreatePublicThreads|SendMessagesInThreads|ReadMessageHistory|AddReactions|EmbedLinks|AttachFiles)
Defensive patterns
Strategy: validation
Validate before calling
const REQUIRED = BigInt(0x400 | 0x800 | 0x40000 | 0x100000 | 0x10000 | 0x40 | 0x4000 | 0x8000); // verify via the API: compute effective perms for each text channel the bot can see; // if none satisfies REQUIRED, show the setup URL with those permission bits before calling listDiscordBotChannels
Try / catch
try {
const inv = await listDiscordBotChannels({ botUserId, botToken, fetch, guildId });
} catch (err) {
if (err instanceof Error && err.message.startsWith("Discord bot needs View Channels")) {
redirectToBotInviteUrl({ guildId, permissions: "35803776" });
} else throw err;
} Prevention
- Always invite the bot with an explicit permissions= integer covering all eight required permission bits
- Document the required channel permissions in setup UI before the inventory step runs
- After role changes on the server, re-run the channel inventory to catch newly denied channels
When it happens
Trigger: listDiscordBotChannels succeeds at fetching guild/member/roles/channels, but for every type-0 channel the computed permissions bitmask is missing at least one of: View Channels, Send Messages, Create Public Threads, Send Messages in Threads, Read Message History, Add Reactions, Embed Links, Attach Files.
Common situations: Bot invited with the default 'bot' scope but no permission checkboxes ticked; server admins applied role/channel denies that strip Send Messages or View Channels everywhere; all channels are private (type != 0 visible to bot, or bot role lacks access); @everyone role denies View Channels and the bot has no roles granting it.
Understand the failure class
Background: "You do not have permission" / 403 Forbidden errors: authenticated but not allowed — causes and fixes across open-source libraries — this error's family across 31 libraries.
Related errors
- Discord bot is not installed in the selected server
- Discord bot membership could not be verified
- invalid_response
- Invalid Discord command registration authority
- Discord command registration authorization denied
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10).
Data as JSON: /api/errors/5812bcfe3c24521d.
Report an issue: GitHub.