nyxx-discord / nyxx

Wrapper around Discord API for Dart
Apache License 2.0
326 stars 49 forks source link

Cannot get guild information using OAuth2 #630

Closed MCausc78 closed 6 months ago

MCausc78 commented 7 months ago

Describe the bug

Note: partial guilds in nyxx do have only id **To Reproduce** ```dart import 'dart:io'; import 'package:nyxx/nyxx.dart'; void main() async { final accessToken = 'blah blah'; final client = await Nyxx.connectOAuth2(Credentials(accessToken, scopes: ['guilds'])); PartialGuild guild = await client.users.listCurrentUserGuilds().then((guilds) => guilds[0]); print(guild); // OK print(await guild.get()); // Fail } ``` **Expected behavior** To get guild information using Bearer token, such as name, permissions, whether user is owner, features, etc **Screenshots** ![image](https://github.com/nyxx-discord/nyxx/assets/101461652/9358875e-d954-4e73-b6e5-aefdc5e03787) (notice the `401: unauthorized` in end (`GET /guilds/{guild.id}`)) **Desktop (please complete the following information):** - OS: unrelated - Dart version: unrelated - Nyxx version: v6.1.0 **Additional context** API provides guild information in `/users/@me/guilds`: https://discord.com/developers/docs/resources/user#get-current-user-guilds </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>