mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
One Liner style?
This commit is contained in:
@@ -107,10 +107,8 @@ class DiscordOAuth2HttpClient(abc.ABC):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
route = configs.DISCORD_API_BASE_URL + route
|
route = configs.DISCORD_API_BASE_URL + route
|
||||||
if oauth:
|
response = self._make_session(
|
||||||
response = self._make_session().request(method, route, data, **kwargs)
|
).request(method, route, data, **kwargs) if oauth else requests.request(method, route, data=data, **kwargs)
|
||||||
else:
|
|
||||||
response = requests.request(method, route, data=data, **kwargs)
|
|
||||||
|
|
||||||
if response.status_code == 401:
|
if response.status_code == 401:
|
||||||
raise exceptions.Unauthorized
|
raise exceptions.Unauthorized
|
||||||
|
|||||||
Reference in New Issue
Block a user