Skip to content

Commit f68155e

Browse files
committed
even more typo fixes
1 parent fcb5883 commit f68155e

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

discordoauth2/async_oauth.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def fetch_identify(self) -> dict:
3131
return await response.json()
3232
elif response.status == 401:
3333
raise Exceptions.Forbidden(
34-
f"this AccessToken does not have the nessasary scope."
34+
f"this AccessToken does not have the necessary scope."
3535
)
3636
elif response.status == 429:
3737
raise Exceptions.RateLimited(
@@ -54,7 +54,7 @@ async def fetch_connections(self) -> list[dict]:
5454
return await response.json()
5555
elif response.status == 401:
5656
raise Exceptions.Forbidden(
57-
f"this AccessToken does not have the nessasary scope."
57+
f"this AccessToken does not have the necessary scope."
5858
)
5959
elif response.status == 429:
6060
raise Exceptions.RateLimited(
@@ -78,7 +78,7 @@ async def fetch_guilds(self) -> list[dict]:
7878
return await response.json()
7979
elif response.status == 401:
8080
raise Exceptions.Forbidden(
81-
f"this AccessToken does not have the nessasary scope."
81+
f"this AccessToken does not have the necessary scope."
8282
)
8383
elif response.status == 429:
8484
raise Exceptions.RateLimited(
@@ -104,7 +104,7 @@ async def fetch_guild_member(self, guild_id: int) -> dict:
104104
return await response.json()
105105
elif response.status == 401:
106106
raise Exceptions.Forbidden(
107-
f"this AccessToken does not have the nessasary scope."
107+
f"this AccessToken does not have the necessary scope."
108108
)
109109
elif response.status == 404:
110110
raise Exceptions.HTTPException(
@@ -133,10 +133,10 @@ async def join_guild(
133133
134134
guild_id: The guild ID to add the user to
135135
user_id: The ID of the user. Retrievable with `PartialAccessToken.fetch_identify()['id']`
136-
nick: The nickname to give the user apon joining. Bot must also have `MANAGE_NICKNAMES`
137-
role_ids: A list of role IDs to give the user apon joining (bypasses Membership Screening). Bot must also have `MANAGE_ROLES`
138-
mute: Wether the user is muted in voice channels apon joining. Bot must also have `MUTE_MEMBERS`
139-
deaf: Wether the user is deaf in voice channels apon joining. Bot must also have `DEAFEN_MEMBERS`
136+
nick: The nickname to give the user upon joining. Bot must also have `MANAGE_NICKNAMES`
137+
role_ids: A list of role IDs to give the user upon joining (bypasses Membership Screening). Bot must also have `MANAGE_ROLES`
138+
mute: Wether the user is muted in voice channels upon joining. Bot must also have `MUTE_MEMBERS`
139+
deaf: Wether the user is deaf in voice channels upon joining. Bot must also have `DEAFEN_MEMBERS`
140140
"""
141141
async with aiohttp.ClientSession() as session:
142142
async with session.put(
@@ -187,7 +187,7 @@ async def fetch_metadata(self):
187187
return await response.json()
188188
elif response.status == 401:
189189
raise Exceptions.Forbidden(
190-
f"this AccessToken does not have the nessasary scope."
190+
f"this AccessToken does not have the necessary scope."
191191
)
192192
elif response.status == 429:
193193
raise Exceptions.RateLimited(
@@ -234,7 +234,7 @@ def metadataTypeHook(item):
234234
return await response.json()
235235
elif response.status == 401:
236236
raise Exceptions.Forbidden(
237-
f"this AccessToken does not have the nessasary scope."
237+
f"this AccessToken does not have the necessary scope."
238238
)
239239
elif response.status == 429:
240240
raise Exceptions.RateLimited(
@@ -258,7 +258,7 @@ async def clear_metadata(self):
258258
return await response.json()
259259
elif response.status == 401:
260260
raise Exceptions.Forbidden(
261-
f"this AccessToken does not have the nessasary scope."
261+
f"this AccessToken does not have the necessary scope."
262262
)
263263
elif response.status == 429:
264264
raise Exceptions.RateLimited(
@@ -320,7 +320,7 @@ async def update_linked_roles_metadata(self, metadata: list[dict]):
320320
return await response.json()
321321
elif response.status == 401:
322322
raise Exceptions.Forbidden(
323-
f"this AccessToken does not have the nessasary scope."
323+
f"this AccessToken does not have the necessary scope."
324324
)
325325
elif response.status == 429:
326326
raise Exceptions.RateLimited(
@@ -333,7 +333,7 @@ async def update_linked_roles_metadata(self, metadata: list[dict]):
333333
)
334334

335335
def from_access_token(self, access_token: str) -> AsyncPartialAccessToken:
336-
"""Creates a `PartialAccessToken` from a access token string.
336+
"""Creates a `PartialAccessToken` from an access token string.
337337
338338
access_token: access token from `PartialAccessToken.token`
339339
"""
@@ -342,7 +342,7 @@ def from_access_token(self, access_token: str) -> AsyncPartialAccessToken:
342342
async def exchange_code(self, code: str) -> AsyncAccessToken:
343343
"""Converts a code from the redirect url into a `AccessToken`
344344
345-
code: `code` paramater from OAuth2 redirect URL
345+
code: `code` parameter from OAuth2 redirect URL
346346
"""
347347
async with aiohttp.ClientSession() as session:
348348
async with session.post(
@@ -402,7 +402,7 @@ async def refresh_token(self, refresh_token: str) -> AsyncAccessToken:
402402
f"Unexpected HTTP {response.status}"
403403
)
404404

405-
async def client_credentails_grant(
405+
async def client_credentials_grant(
406406
self, scope: list[str]
407407
) -> AsyncAccessToken:
408408
"""Creates an `AccessToken` on behalf of the application's owner. If the owner is a team, then only `identify` and `applications.commands.update` are allowed.

discordoauth2/sync_oauth.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def fetch_identify(self) -> dict:
2727
return response.json()
2828
elif response.status_code == 401:
2929
raise Exceptions.Forbidden(
30-
f"this AccessToken does not have the nessasary scope."
30+
f"this AccessToken does not have the necessary scope."
3131
)
3232
elif response.status_code == 429:
3333
raise Exceptions.RateLimited(
@@ -50,7 +50,7 @@ def fetch_connections(self) -> list[dict]:
5050
return response.json()
5151
elif response.status_code == 401:
5252
raise Exceptions.Forbidden(
53-
f"this AccessToken does not have the nessasary scope."
53+
f"this AccessToken does not have the necessary scope."
5454
)
5555
elif response.status_code == 429:
5656
raise Exceptions.RateLimited(
@@ -74,7 +74,7 @@ def fetch_guilds(self) -> list[dict]:
7474
return response.json()
7575
elif response.status_code == 401:
7676
raise Exceptions.Forbidden(
77-
f"this AccessToken does not have the nessasary scope."
77+
f"this AccessToken does not have the necessary scope."
7878
)
7979
elif response.status_code == 429:
8080
raise Exceptions.RateLimited(
@@ -100,7 +100,7 @@ def fetch_guild_member(self, guild_id: int) -> dict:
100100
return response.json()
101101
elif response.status_code == 401:
102102
raise Exceptions.Forbidden(
103-
f"this AccessToken does not have the nessasary scope."
103+
f"this AccessToken does not have the necessary scope."
104104
)
105105
elif response.status_code == 404:
106106
raise Exceptions.HTTPException(f"user is not in this guild.")
@@ -127,10 +127,10 @@ def join_guild(
127127
128128
guild_id: The guild ID to add the user to
129129
user_id: The ID of the user. Retrievable with `PartialAccessToken.fetch_identify()['id']`
130-
nick: The nickname to give the user apon joining. Bot must also have `MANAGE_NICKNAMES`
131-
role_ids: A list of role IDs to give the user apon joining (bypasses Membership Screening). Bot must also have `MANAGE_ROLES`
132-
mute: Wether the user is muted in voice channels apon joining. Bot must also have `MUTE_MEMBERS`
133-
deaf: Wether the user is deaf in voice channels apon joining. Bot must also have `DEAFEN_MEMBERS`
130+
nick: The nickname to give the user upon joining. Bot must also have `MANAGE_NICKNAMES`
131+
role_ids: A list of role IDs to give the user upon joining (bypasses Membership Screening). Bot must also have `MANAGE_ROLES`
132+
mute: Wether the user is muted in voice channels upon joining. Bot must also have `MUTE_MEMBERS`
133+
deaf: Wether the user is deaf in voice channels upon joining. Bot must also have `DEAFEN_MEMBERS`
134134
"""
135135
response = requests.put(
136136
f"https://discord.com/api/v10/guilds/{guild_id}/members/{user_id}",
@@ -150,7 +150,7 @@ def join_guild(
150150
return response.json()
151151
elif response.status_code == 401:
152152
raise Exceptions.Forbidden(
153-
f"this AccessToken does not have the nessasary scope."
153+
f"this AccessToken does not have the necessary scope."
154154
)
155155
elif response.status_code == 403:
156156
raise Exceptions.Forbidden(
@@ -177,7 +177,7 @@ def fetch_metadata(self):
177177
return response.json()
178178
elif response.status_code == 401:
179179
raise Exceptions.Forbidden(
180-
f"this AccessToken does not have the nessasary scope."
180+
f"this AccessToken does not have the necessary scope."
181181
)
182182
elif response.status_code == 429:
183183
raise Exceptions.RateLimited(
@@ -224,7 +224,7 @@ def metadataTypeHook(item):
224224
return response.json()
225225
elif response.status_code == 401:
226226
raise Exceptions.Forbidden(
227-
f"this AccessToken does not have the nessasary scope."
227+
f"this AccessToken does not have the necessary scope."
228228
)
229229
elif response.status_code == 429:
230230
raise Exceptions.RateLimited(
@@ -248,7 +248,7 @@ def clear_metadata(self):
248248
return response.json()
249249
elif response.status_code == 401:
250250
raise Exceptions.Forbidden(
251-
f"this AccessToken does not have the nessasary scope."
251+
f"this AccessToken does not have the necessary scope."
252252
)
253253
elif response.status_code == 429:
254254
raise Exceptions.RateLimited(
@@ -307,7 +307,7 @@ def update_linked_roles_metadata(self, metadata: list[dict]):
307307
)
308308

309309
def from_access_token(self, access_token: str) -> PartialAccessToken:
310-
"""Creates a `PartialAccessToken` from a access token string.
310+
"""Creates a `PartialAccessToken` from an access token string.
311311
312312
access_token: access token from `PartialAccessToken.token`
313313
"""
@@ -316,7 +316,7 @@ def from_access_token(self, access_token: str) -> PartialAccessToken:
316316
def exchange_code(self, code: str) -> AccessToken:
317317
"""Converts a code from the redirect url into a `AccessToken`
318318
319-
code: `code` paramater from OAuth2 redirect URL
319+
code: `code` parameter from OAuth2 redirect URL
320320
"""
321321
response = requests.post(
322322
"https://discord.com/api/v10/oauth2/token",
@@ -376,7 +376,7 @@ def refresh_token(self, refresh_token: str) -> AccessToken:
376376
f"Unexpected HTTP {response.status_code}"
377377
)
378378

379-
def client_credentails_grant(self, scope: list[str]) -> AccessToken:
379+
def client_credentials_grant(self, scope: list[str]) -> AccessToken:
380380
"""Creates an `AccessToken` on behalf of the application's owner. If the owner is a team, then only `identify` and `applications.commands.update` are allowed.
381381
382382
scope: list of string scopes to authorize.
@@ -421,7 +421,7 @@ def revoke_token(self, token: str, token_type: str = None):
421421
return
422422
elif response.status_code == 401:
423423
raise Exceptions.Forbidden(
424-
f"this AccessToken does not have the nessasary scope."
424+
f"this AccessToken does not have the necessary scope."
425425
)
426426
elif response.status_code == 429:
427427
raise Exceptions.RateLimited(

0 commit comments

Comments
 (0)