Metadata-Version: 2.1
Name: discord-ext-oauth
Version: 0.1.0
Summary: An asynchronous OAuth2 extension for discord.py.
Home-page: https://github.com/moanie/discord.ext.oauth
Author: moanie
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Requires-Python: >=3.7.0
Description-Content-Type: text/markdown
Requires-Dist: aiohttp
Provides-Extra: speedups
Requires-Dist: aiohttp[speedups] ; extra == 'speedups'

<h1 align="center">
<sub>
    <img src=".github/icon.png" height="36">
</sub>
&nbsp;
discord-ext-oauth
</h1>
<p align="center">
<sup>
An asynchronous OAuth2 extension for discord.py.
</sup>
<br>
<sup>
    <a href="">Read the documentation online.</a>
</sup>
</p>

***
## Installing the extension
> Installing the stable version:
> ```sh
> pip install discord-ext-oauth
> ```

> Installing the development version:
> ```sh
> pip install git+https://github/moanie/discord-ext-oauth
> ```

## Example Usage
```py
import asyncio
from discord.ext import oauth

client = oauth.OAuth2Client(
    client_id = 000000000000000000,
    client_secret = "CLIENT_SECRET",
    redirect_uri = "https://www.google.com/",
    scopes = ["identify",  "guilds", "email", "connections"]
)


async def main():
    resp = await client.exchange_code("access_token_here")
    user = await client.fetch_user(resp)
    print(f"User ID: {user.id}")
    print(f"User Avatar URL: {user.avatar_url}")
    await client.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
> Output
> ```sh
> User ID: 691406006277898302
> User Avatar URL: https://cdn.discordapp.com/avatars/691406006277898302/5c8f69a903a8c5e34f93fe6ece5348c7.png 
> ```




