Quart-Nextcord – DEV Community

Quart-Nextcord is an extension for nextcord. Associated hyperlinks Instance from quart import Quart, redirect, url_for from quart_nextcord import DiscordOAuth2Session, requires_authorization, Unauthorized app = Quart(__name__) app.secret_key = b”random bytes representing quart secret key” app.config[“DISCORD_CLIENT_ID”https://style-tricks.com/invalidlenni/] = 490732332240863233  # Discord shopper ID. app.config[“DISCORD_CLIENT_SECRET”https://style-tricks.com/invalidlenni/] = “”https://style-tricks.com/invalidlenni/  # Discord shopper secret. app.config[“DISCORD_REDIRECT_URI”https://style-tricks.com/invalidlenni/] = “”https://style-tricks.com/invalidlenni/  # URL to your callback endpoint. app.config[“DISCORD_BOT_TOKEN”https://style-tricks.com/invalidlenni/] = “”https://style-tricks.com/invalidlenni/  # Required to entry BOT assets. nextcord = DiscordOAuth2Session(app) @app.route(“/login/”https://style-tricks.com/invalidlenni/) async def login():     return await nextcord.create_session() @app.route(“/callback/”https://style-tricks.com/invalidlenni/) async def callback():     await nextcord.callback()     return redirect(url_for(“.me”https://style-tricks.com/invalidlenni/)) @app.errorhandler(Unauthorized) async def redirect_unauthorized(e):     return redirect(url_for(“login”https://style-tricks.com/invalidlenni/)) @app.route(“/me/”https://style-tricks.com/invalidlenni/) @requires_authorization async def me():     person = await nextcord.fetch_user()     return f”””     <html>         <head>             <title>{person.identify}</title>         </head>         <physique>             <img src=”https://style-tricks.com/invalidlenni/{person.avatar_url}” />         </physique>     </html>””” if __name__ == “__main__”https://style-tricks.com/invalidlenni/:     app.run() Enter fullscreen mode Exit fullscreen mode Go to https://github.com/InvalidLenni/Quart-Nextcord/discussions Go to https://github.com/InvalidLenni/Quart-Nextcord/issues/new […]