Add route to directly add to provided server ID in route

This commit is contained in:
thecosmos
2020-04-15 18:35:05 +05:30
parent b0cfdbd3d6
commit c0884b2c1d

View File

@@ -38,13 +38,18 @@ def me():
<body><img src='{user.avatar_url}' /> <body><img src='{user.avatar_url}' />
<a href={url_for("my_connections")}>Connections</a> <a href={url_for("my_connections")}>Connections</a>
<br /> <br />
<a href={user.add_to_guild(475549041741135881)}>Add me to square server!</a>
</body> </body>
</html> </html>
""" """
@app.route("/add_to/<int:guild_id>/")
def add_to_guild(guild_id):
user = discord.fetch_user()
return user.add_to_guild(guild_id)
@app.route("/me/connections/") @app.route("/me/connections/")
def my_connections(): def my_connections():
user = discord.fetch_user() user = discord.fetch_user()