mirror of
https://github.com/yawaflua/Flask-Discord.git
synced 2025-12-10 04:19:31 +02:00
Use and implement generalized request method rather than just get.
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user