discord_port is a simple way to make auth with the Discord API!
Project description
Discord Port
Way to make an easy Oauth2 with discord API
How it's work?
pip install discord-port
Create AuthClient
import discord_port
passport = discord_port.AuthClient(c,client_id=None,client_secret=None,redirect_uri=None)
Exchange for the code
import discord_port
passport = discord_port.AuthClient(c,client_id=None,client_secret=None,redirect_uri=None)
#This using a framework called FLASK `pip install flask`
@app.route('/discord/api/oauth2')
def oauth():
paylaod_recived = passport.get_code(request.args["code"])
"""
The payload will return as
{
"access_token": "6qrZcUqja7812RVdnEKjpzOL4CvHBFG",
"token_type": "Bearer",
"expires_in": 604800,
"refresh_token": "D43f5y0ahjqew82jZ4NViEr2YafMKhue",
"scope": "identify"
}
"""
return paylaod_recived["access_token"]
Get UserLogged
import discord_port
discord_port.UserAPI(code="access_token").get_user
Made by 🇮🇶 Iraqi hands : airbu#1745 in 7:40AM GMT+3
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
discord_port-1.4.tar.gz
(3.6 kB
view details)
File details
Details for the file discord_port-1.4.tar.gz.
File metadata
- Download URL: discord_port-1.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d6a0f41232f0113aea993d4c708da0181ec51835e38166695a4d1888534f8322
|
|
| MD5 |
7fe6a03db706e95ee04e1c975acbdeee
|
|
| BLAKE2b-256 |
30b543aa4e235f11fb19118bf0b9179d79564f1f6787a41ee993da64582b1964
|