Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

403 Getting Guild Info / Channel Messages #177

Open
ChrisYatesUK opened this issue Feb 5, 2022 · 1 comment
Open

403 Getting Guild Info / Channel Messages #177

ChrisYatesUK opened this issue Feb 5, 2022 · 1 comment

Comments

@ChrisYatesUK
Copy link

OK so my bot requires the scopes : read messages & message history
Permission integer :66560
The bot has been authorised using the generated link by the server owner
I have tested it on the test server I created for test messages and it works however when I try it with the other server
that its just been authorised on it gives a 403

$discord = new DiscordClient(['token' => 'My Token Here','tokenType' => 'Bot']);
$channel = 933010260027932735; // My Channel
$main = 924525404658749500; // Channel trying to pull
print_r($discord->channel->getChannelMessages(['channel.id' => $channel]))
Gives me the JSON data
However when I change it to $main I get this error
Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: GET https://discord.com/api/v6/channels/924525404658749500/messages resulted in a 403 Forbidden response:

in /home/chrisyat/public_html/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/chrisyat/public_html/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 /home/chrisyat/public_html/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response))
#2 /home/chrisyat/public_html/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), NULL)
#3 /home/chrisyat/public_html/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}()
#4 /home/chrisyat/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php(118): in /home/chrisyat/public_html/vendor/guzzlehttp/command/src/Exception/CommandException.php on line 57

The same when try and pull the guild info

I know he authorised it because I got the auth redirect page to create a dump with the server info upon successful token creation

Its driving me crazy now so any help is greatly appreciated

@ChrisYatesUK
Copy link
Author

Also on the redirect url after the person clicks the authorisation link
Am I right to assume the
'client_id' => OAUTH2_CLIENT_ID,
'client_secret' => OAUTH2_CLIENT_SECRET,
needs to be the values in the bot OAUTH page ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant