Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
main.py
rewrite.py
discordoauth2/__pycache__
.idea/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ I've finally published the library to PyPi! So now you can use pip.
```
pip install discord-oauth2.py
```

### Example With Flask
Don't forget to replace all the client information with your application's own information. You can leave bot token empty if your not adding members to guilds.
```py
Expand Down Expand Up @@ -57,3 +58,6 @@ def oauth2():

app.run("0.0.0.0", 8080)
```

### Async usage
Asynchronous usage is also supported, you can use the async version of the library by importing `discordoauth2.AsyncClient` instead of `discordoauth2.Client`. The methods are the same, but they’re coroutines.
310 changes: 14 additions & 296 deletions discordoauth2/__init__.py

Large diffs are not rendered by default.

453 changes: 453 additions & 0 deletions discordoauth2/async_oauth.py

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions discordoauth2/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class Exceptions:
class BaseException(Exception):
pass

class HTTPException(BaseException):
pass

class RateLimited(HTTPException):
def __init__(self, text, retry_after):
self.retry_after = retry_after
super().__init__(text)

class Forbidden(HTTPException):
pass


# Alias for compatibility with the old version, but class names should follow the CapitalizedWords convention
exceptions = Exceptions
434 changes: 434 additions & 0 deletions discordoauth2/sync_oauth.py

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@

# -- Project information

project = 'discordoauth2.py'
copyright = '2022, TreeBen77'
author = 'TreeBen77'
project = "discordoauth2.py"
copyright = "2022, TreeBen77"
author = "TreeBen77"

release = '1.1'
version = '1.1.1'
release = "1.1"
version = "1.1.1"

# -- General configuration

extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.intersphinx',
"sphinx.ext.duration",
"sphinx.ext.doctest",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.intersphinx",
]

intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
"python": ("https://docs.python.org/3/", None),
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
}
intersphinx_disabled_domains = ['std']
intersphinx_disabled_domains = ["std"]

templates_path = ['_templates']
templates_path = ["_templates"]

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# -- Options for EPUB output
epub_show_urls = 'footnote'
epub_show_urls = "footnote"
21 changes: 10 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@
long_description = file.read()

setup(
name='discord-oauth2.py',
description='Use Discord\'s OAuth2 effortlessly! Turns the auth code to a access token and the access token into scope infomation. ',
name="discord-oauth2.py",
description="Use Discord's OAuth2 effortlessly! Turns the auth code to a access token and the access token into scope infomation. ",
version="1.2.1",
long_description=long_description,
long_description_content_type="text/markdown",
license='MIT',
python_requires='>=3.8',
license="MIT",
python_requires=">=3.8",
author="TreeBen77",
packages=[
'discordoauth2'
],
url='https://github.com/TreeBen77/discordoauth2',
keywords='flask, oauth2, discord, discord-api',
packages=["discordoauth2"],
url="https://github.com/TreeBen77/discordoauth2",
keywords="flask, oauth2, discord, discord-api",
install_requires=[
'requests'
]
"aiohttp",
"requests",
],
)