Giter Club home page Giter Club logo

discord.ext.oauth's Introduction

Hey There. I'm Vish!

Nice to meet you! My name on the internet is Vish! I'm currently an avid Python developer, working on Discord Bots, API's, websites and asynchronous libraries! I'm currently in Year 12, and I work with a number of technologies such as Redis, PostgreSQL, MongoDB, Python, HTML and Tailwind CSS!

Technologies and Tools I work with:

CSS3 Go JavaScript Lua Python Rust Azure Cloudflare DigitalOcean Google Cloud Nginx Django FastAPI Flask TailwindCSS MongoDB MySQL Postgres Redis SQLite NumPy DjangoREST Jinja Pandas Postman Swagger Raspberry Pi

Donate

Buy Me a Coffee at ko-fi.com

Contacting Me

discord.ext.oauth's People

Contributors

justanotherbyte avatar leg3ndary avatar tari-dev avatar

Stargazers

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

Watchers

 avatar

discord.ext.oauth's Issues

Bug with fetch_user

While fetching a user with a default avatar, I get an AttributeError:

File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/oauth/client.py", line 111, in fetch_user
user = User(http=self.http, data=resp, acr=access_token_response)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/oauth/user.py", line 48, in init
self._avatar_format = "gif" if self._avatar_hash.startswith("a") else "png"
AttributeError: 'NoneType' object has no attribute 'startswith'

NameError name 'Guild' is not defined

image

async def fetch_guilds(self, *, refresh: bool = True) -> List[Guild]:
        """Makes an api call to fetch the guilds the user is in. Can fill a normal dictionary cache.

        :param refresh: Whether or not to refresh the guild cache attached to this user object. If false, returns the cached guilds, defaults to True
        :type refresh: bool, optional
        :return: A List of Guild objects either from cache or returned from the api call 
        :rtype: List[Guild]
        """
        if not refresh and self.guilds:
            return self.guilds

        route = Route("GET", "/users/@me/guilds")
        headers = {"Authorization": "Bearer {}".format(self.access_token)}
        resp = await self._http.request(route, headers=headers)
        self.guilds = []
        for array in resp:
            guild = Guild(data=array, user=self)
            self.guilds.append(guild)

        return self.guilds

I believe my code is correct, as attributes like .id and .avatar_url return correctly, but await user.fetch_guilds() throws this error.

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.