Code Monkey home page Code Monkey logo

discord-oauth2.py's Introduction

Hi, Iโ€™m TreeBen77, I know how to code things in Python and Roblox Lua pretty well. I'm learning web development (HTML, CSS, and JavaScript) and I'm doing pretty well. I own the TreeBen77 Studios Roblox group, but not much is happening there.

Programming Languages

Static Badge Static Badge Static Badge Static Badge Static Badge

IDEs

Static Badge Static Badge

You can contact me in my Discord server: https://discord.gg/4CSc9E5uQy, or on Roblox @TreeBen77

discord-oauth2.py's People

Contributors

timo-development avatar treeben77 avatar zimpatrick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

discord-oauth2.py's Issues

Error: Scope wasn't granted in OAuth2.

I get an error when I try to join my bot to a server, it has successfully joined the server, I don't know why there is this error :/

The error output:

[2022-06-05 13:07:29,708] ERROR in app: Exception on /oauth2 [GET]
Traceback (most recent call last):
  File "/home/bensuperpc/.local/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/bensuperpc/.local/lib/python3.10/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/bensuperpc/.local/lib/python3.10/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/bensuperpc/.local/lib/python3.10/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/run/media/bensuperpc/MainT7/Depot_git/repos_perso/discord-bot/app.py", line 34, in oauth
    tokenObject.access.guilds_join(XXXXXXXXXXXXXXX)
  File "/run/media/bensuperpc/MainT7/Depot_git/repos_perso/discord-bot/discordoauth2.py", line 54, in guilds_join
    if user_object.status_code == 401: raise Exception(f"Scope wasn't granted in OAuth2.")
Exception: Scope wasn't granted in OAuth2.

The code:

client = discordOauth2(client=XXXXXXXXXXX, secret="XXXXXXXXXXXXXXX",
redirect="http://localhost:8080/oauth2", token="XXXXXXXX")

  # Your OAuth2 url, you can make one a https://discord.dev
  return redirect("https://discord.com/api/oauth2/authorize?client_id=XXXXXXXXXXX&permissions=8&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2&response_type=code&scope=bot%20guilds%20guilds.join%20guilds.members.read%20connections%20email%20identify")

  tokenObject.access.guilds_join(XXXXXXXXXX)

Selected fields:

Screenshot_20220605_131815

Screenshot_20220605_132347

Screenshot_20220605_132407

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.