An asynchronous OAuth2 extension for discord.py.
Project description
discord-ext-oauth
An asynchronous OAuth2 extension for discord.py.
Read the documentation online.
Installing the extension
Installing the stable version:
pip install discord-ext-oauth
Installing the development version:
pip install git+https://github/moanie/discord-ext-oauth
Example Usage
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
User ID: 691406006277898302 User Avatar URL: https://cdn.discordapp.com/avatars/691406006277898302/5c8f69a903a8c5e34f93fe6ece5348c7.png
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for discord_ext_oauth-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b805c122bbdc3bdad3768976f054a6088b7e58b43acfca2fcbbdc8d8d6425469 |
|
MD5 | 72e832e246fce8226955830f9f2c5f53 |
|
BLAKE2b-256 | e2997ac1395a44b0295e42904c4a339ee0bdc277f2d572f7bb25899465662c2c |