Why do i get bad request

When i use the following scopes identify email guilds it works perfect but when i add guilds.channels.read i get bad request?
public function redirectToDiscord()
{
$query = http_build_query([
'client_id' => env('DISCORD_CLIENT_ID'),
'redirect_uri' => env('DISCORD_REDIRECT_URI'),
'response_type' => 'code',
'scope' => 'identify email guilds guilds.channels.read',
]);

return redirect('https://discord.com/api/oauth2/authorize?' . $query);
}
public function redirectToDiscord()
{
$query = http_build_query([
'client_id' => env('DISCORD_CLIENT_ID'),
'redirect_uri' => env('DISCORD_REDIRECT_URI'),
'response_type' => 'code',
'scope' => 'identify email guilds guilds.channels.read',
]);

return redirect('https://discord.com/api/oauth2/authorize?' . $query);
}
15 Replies
d.js toolkit
d.js toolkit4w ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Octoboomer
Octoboomer4w ago
That’s not a valid OAuth2 scope What are you trying to do? Reading messages sent in guilds that a user is in isn’t a thing
HenkieThee
HenkieTheeOP4w ago
no i want to read the channel names so you can select a channel the bot should send the message
HenkieThee
HenkieTheeOP4w ago
No description
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
HenkieThee
HenkieTheeOP4w ago
yes
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
HenkieThee
HenkieTheeOP4w ago
ow no im sorry this is the web part
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
HenkieThee
HenkieTheeOP4w ago
what do you mean? like web api requests can't contain the scope guilds.channels.read?
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
HenkieThee
HenkieTheeOP4w ago
ah, yea im building my discord bot itself with discord.js but it also includes a web panel
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
HenkieThee
HenkieTheeOP4w ago
only now i need to manually put the channel id in, it would be better if i could select a channel alright! thanks
Octoboomer
Octoboomer4w ago
Discord Developer Portal
Discord Developer Portal — API Docs for Bots and Developers
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

Did you find this page helpful?