Closed ghost closed 2 years ago
This isn't to do with discord.js, it's just as you're told: you don't have permissions. Additionally, the screenshot you provided doesn't have embed links enabled and people may take permissions away from your bot.
Thanks for the reply.
I am starting to wonder if it is an issue with discordjs as I am able to edit the reply with an embed, without those permissions.
Even with those permissions I cannot send the embed successfully.
Why can I edit the reply with an embed, but not send a new message to the channel with the embed?
Permissions errors come from the Discord API, not discord.js. The library does not perform internal permissions checks.
Right, but that's still not explaining why it works when it's via interaction.reply
and not working when it's from channel.send
?
Interaction replies use Webhooks to respond - their permissions are inherently tied to the everyone role, not your bot user.
Ah, that makes sense.
I have tried sitting there putting on all types of permissions for the deployment, and I can't seem to get it work.
It doesn't work with embed links turned on either as the user above suggested. Do you have any immediate thoughts?
I really appreciate the help - i've been stuck on this for ages
For example - putting every permission except for Administrator it still doesn't work:
Is it something I'm missing with Intents?
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});```
Changing the values for the invite link won't change any already set permissions. You need to go into the relevant guild and grant the bot the permission(s) there.
Changing the values for the invite link won't change any already set permissions. You need to go into the relevant guild and grant the bot the permission(s) there.
Changing them and re-adding to the server does update the role assigned to the bot.
If the bot is having those permission on its integration role and you are getting that error when sending a message, then there is an overwrite denying the permission(s) in place.
Thanks - where can I troubleshoot what may be overwriting?
@SpaceEEC Ok, that was perfect, I found that @everyone
had embed-links turned off for the channel.
Is there a way to have my bot not be defined / affected by over-writes like that?
Only by granting it the administrator permission. (You could also create an overwrite granting for the bot / integration role, allowing that bit, behaves slightly different, but would also work here)
Which package is this bug report for?
discord.js
Issue description
https://github.com/kennedybaird/discord-embed-error
Clone repository, npm install, create bot and add to testing server.
Use command
/list-item issue: 2
ephemeral message will populate with embedUse command
/list-item issue: 1
tries to use channel.send to send an embed, but gives permissions error.Error does not appear when setting bot permissions to administrator.
Permissions as so:
Code sample
No response
Package version
v13
Node.js version
16.13.2
Operating system
Linux
Priority this issue should have
Medium (should be fixed soon)
Which partials do you have configured?
No Partials
Which gateway intents are you subscribing to?
Guilds, GuildMessages
I have tested this issue on a development release
No response