Use and implement generalized request method rather than just get.

This commit is contained in:
thecosmos
2020-04-14 09:21:36 +05:30
parent 03952f66f9
commit 030333987f
3 changed files with 20 additions and 11 deletions

View File

@@ -17,7 +17,7 @@ discord = DiscordOAuth2Session(app)
@app.route("/")
def index():
return discord.create_session()
return discord.create_session(["guilds", "connections"])
@app.route("/callback/")
@@ -26,6 +26,11 @@ def callback():
return redirect(url_for(".me"))
@app.route("/get_json/")
def get_json():
return discord.get_json()
@app.route("/me/")
def me():
user = discord.fetch_user()
@@ -36,6 +41,7 @@ def me():
</head>
<body><img src='{user.avatar_url}' />
<a href={url_for("my_connections")}>Connections</a>
<a href={url_for("get_json")}>Get default JSON.</a>
</body>
</html>