mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
Move attributes from base class to actual client
This commit is contained in:
@@ -15,25 +15,8 @@ from requests_oauthlib import OAuth2Session
|
|||||||
|
|
||||||
class DiscordOAuth2HttpClient(abc.ABC):
|
class DiscordOAuth2HttpClient(abc.ABC):
|
||||||
"""An OAuth2 http abstract base class providing some factory methods.
|
"""An OAuth2 http abstract base class providing some factory methods.
|
||||||
This class is meant to be overridden by :py:class:`flask_discord.DiscordOAuth2Session`
|
This class is meant to be overridden by :py:class:`flask_discord.DiscordOAuth2Session` and should not be
|
||||||
and should not be used directly.
|
used directly.
|
||||||
|
|
||||||
Attributes
|
|
||||||
----------
|
|
||||||
client_id : int
|
|
||||||
The client ID of discord application provided.
|
|
||||||
client_secret : str
|
|
||||||
The client secret of discord application provided.
|
|
||||||
redirect_uri : str
|
|
||||||
The default URL to use to redirect user to after authorization.
|
|
||||||
bot_token : str
|
|
||||||
The bot token of the application. This is required when you also need to access bot scope resources
|
|
||||||
beyond the normal resources provided by the OAuth. Can be also set to flask config with
|
|
||||||
key ``DISCORD_BOT_TOKEN``.
|
|
||||||
users_cache : cachetools.LFUCache
|
|
||||||
Any dict like mapping to internally cache the authorized users. Preferably an instance of
|
|
||||||
cachetools.LFUCache or cachetools.TTLCache. If not specified, default cachetools.LFUCache is used.
|
|
||||||
Uses the default max limit for cache if ``DISCORD_USERS_CACHE_MAX_LIMIT`` isn't specified in app config.
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,17 @@ class DiscordOAuth2Session(_http.DiscordOAuth2HttpClient):
|
|||||||
cachetools.LFUCache or cachetools.TTLCache. If not specified, default cachetools.LFUCache is used.
|
cachetools.LFUCache or cachetools.TTLCache. If not specified, default cachetools.LFUCache is used.
|
||||||
Uses the default max limit for cache if ``DISCORD_USERS_CACHE_MAX_LIMIT`` isn't specified in app config.
|
Uses the default max limit for cache if ``DISCORD_USERS_CACHE_MAX_LIMIT`` isn't specified in app config.
|
||||||
|
|
||||||
|
Attributes
|
||||||
|
----------
|
||||||
|
client_id : int
|
||||||
|
The client ID of discord application provided.
|
||||||
|
redirect_uri : str
|
||||||
|
The default URL to use to redirect user to after authorization.
|
||||||
|
users_cache : cachetools.LFUCache
|
||||||
|
A dict like mapping to internally cache the authorized users. Preferably an instance of
|
||||||
|
cachetools.LFUCache or cachetools.TTLCache. If not specified, default cachetools.LFUCache is used.
|
||||||
|
Uses the default max limit for cache if ``DISCORD_USERS_CACHE_MAX_LIMIT`` isn't specified in app config.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def create_session(self, scope: list = None, prompt: bool = True, params: dict = None):
|
def create_session(self, scope: list = None, prompt: bool = True, params: dict = None):
|
||||||
|
|||||||
Reference in New Issue
Block a user