Use Discord's OAuth2 effortlessly! Turns the auth code to a access token and the access token into scope infomation.
Project description
DiscordOAuth2.py
Use Discord's OAuth2 effortlessly! Turns the auth code to a access token and the access token into scope infomation.
Useful Links
Discord Server: https://discord.gg/DJ9xbbZAP5
Documentation is coming soon, don't worry.
Quickstart
Installing
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 on line 20 and 21 with your application's own information. You can leave bot token empty if your not adding members to guilds.
import discordoauth2
from flask import Flask, request
client = discordoauth2.Client(849930878276993044, secret="very-secret-code",
redirect="https://findingfakeurlsisprettyhard.tv/oauth2", bot_token="bot-token-only-required-for-guild-joining")
app = Flask(__name__)
@app.route("/oauth2")
def oauth2():
code = request.args.get("code")
access = client.exchange_code(code)
identify = access.fetch_identify()
connections = access.fetch_connections()
guilds = access.fetch_guilds()
return f"""{identify}<br><br>{connections}<br><br>{guilds}"""
app.run("0.0.0.0", 8080)
Project details
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_oauth2.py-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9617b4e3491c7f4ab5ef306cdb0a05af50f7139d407d324270c0d8b45cdaf70a |
|
MD5 | f0e1fd375e67fae034238dd67a282ad0 |
|
BLAKE2b-256 | bc27bf364e85f3a2f1c5b08a15d4986d7a05b7838f834984f6824c3ee676e931 |