Skip to content

Commit e0fa8c5

Browse files
committed
add warnings and fixed incorrect attributes in partialaccesstoken
1 parent f83a332 commit e0fa8c5

File tree

2 files changed

+13
-35
lines changed

2 files changed

+13
-35
lines changed

docs/source/access_token.rst

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ AccessToken
101101
:raises discordoauth2.exceptions.Forbidden: The AccessToken doesn't have the guilds.join scope or the bot isn't in the guild/have the correct permissions.
102102
:raises discordoauth2.exceptions.RateLimited: You're being rate limited.
103103

104+
.. note::
105+
106+
The bot token is required to join guilds, and it must have ``CREATE_INSTANT_INVITE`` in the target server.
107+
104108
.. method:: fetch_metadata()
105109

106110
Returns the user's `metadata object <https://discord.com/developers/docs/resources/user#application-role-connection-object>`__ for this application.
@@ -176,36 +180,6 @@ AccessToken
176180

177181
:type: str
178182

179-
.. attribute:: expires
180-
181-
The number of seconds until it expires from when the instance was created.
182-
183-
:type: int
184-
185-
.. attribute:: scope
186-
187-
A list of scopes that are provided.
188-
189-
:type: list[str]
190-
191-
.. attribute:: refresh_token
192-
193-
The refresh_token for this AccessToken, you can use :class:`discordoauth2.Client.refresh_token` to use this authorization again after it expires.
194-
195-
:type: str
196-
197-
.. attribute:: webhook
198-
199-
A `parital webhook object <https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure>`__ if they was a ``webhook.incoming`` scope.
200-
201-
:type: dict
202-
203-
.. attribute:: guild
204-
205-
A `partial guild object <https://discord.com/developers/docs/resources/guild#guild-object-guild-structure>`__ if a bot was added to a guild.
206-
207-
:type: dict
208-
209183
.. method:: fetch_identify()
210184

211185
Returns a dictionary with a `user object <https://discord.com/developers/docs/resources/user#user-object-user-structure>`__ which includes ``email`` and ``verified`` (verified email) if the ``email`` scope is provided

docs/source/client.rst

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ Client
6060
:raises discordoauth2.exceptions.HTTPException: The request failed, usally because the client ID, client, secret, redirect or code is incorrect
6161
:raises discordoauth2.exceptions.RateLimited: You're being rate limited.
6262

63+
.. warning::
64+
65+
If the application is owned by a team, you can only request for the `identify` scope. You can also request `applications.commands.update`, but the library does not support it yet.
66+
6367
.. method:: revoke_token(token, token_type=None)
6468

6569
Revokes an OAuth2 token related to the client.
@@ -71,15 +75,15 @@ Client
7175

7276
:raises discordoauth2.exceptions.HTTPException: The request failed, usally because the client ID, client, secret, redirect or code is incorrect
7377
:raises discordoauth2.exceptions.RateLimited: You're being rate limited.
74-
75-
.. warning::
76-
77-
If the application is owned by a team, you can only request for the `identify` scope. You can also request `applications.commands.update`, but the library does not support it yet.
7878

7979
.. method:: update_linked_roles_metadata(metadata)
8080

8181
Updates the application's linked roles metadata, requires bot token to have been provided.
8282

8383
.. versionadded:: 1.1
8484

85-
:param dict metadata: Should be a list of `application role connection metadata<https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object>`__
85+
:param dict metadata: Should be a list of `application role connection metadata<https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object>`__
86+
87+
.. note::
88+
89+
The bot token is required to update metadata.

0 commit comments

Comments
 (0)