Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: fix guilds property in client #670

Merged
merged 2 commits into from Apr 5, 2022
Merged

fix!: fix guilds property in client #670

merged 2 commits into from Apr 5, 2022

Conversation

EdVraz
Copy link
Contributor

@EdVraz EdVraz commented Mar 24, 2022

About

Fixes an error occurring because of the cached guild object already having an HTTPClient

Checklist

  • I've ran pre-commit to format and lint the change(s) made.
  • I've checked to make sure the change(s) work on 3.8.6 and higher.
  • This fixes/solves an Issue.
  • I've made this pull request for/as: (check all that apply)
    • Documentation
    • Breaking change
    • New feature/enhancement
    • Bugfix

@EdVraz EdVraz enabled auto-merge (squash) March 24, 2022 15:27
@i0bs
Copy link
Contributor

i0bs commented Mar 31, 2022

In conjunction to client.latency which can be called upon prior to client.start(), I cannot access the client.guilds property method at all in an event listener in a main bot file. Trying this produces an AttributeError, see:

@client.event
async def on_ready():
    print(len(client.guilds))

@EdVraz
Copy link
Contributor Author

EdVraz commented Mar 31, 2022

for me it results in an empty list if not populated in the same event... how would it raise an attribute error?

@i0bs
Copy link
Contributor

i0bs commented Mar 31, 2022

This is from the latest unstable commit:

image

@EdVraz
Copy link
Contributor Author

EdVraz commented Mar 31, 2022

but that would mean the property is nonexistent... how's that possible?

@i0bs
Copy link
Contributor

i0bs commented Mar 31, 2022

beats me i didn't write the code 😂

@EdVraz
Copy link
Contributor Author

EdVraz commented Mar 31, 2022

beats me i didn't write the code 😂

still doesn't make sense that a property, what is in the code, disappears on runtime?

@i0bs
Copy link
Contributor

i0bs commented Mar 31, 2022

let me rephrase:

you're asking the wrong person why, i have zero clue why it's erroring. all i know is that it's broken and it needs to be fixed. pls fix

@EdVraz
Copy link
Contributor Author

EdVraz commented Mar 31, 2022

Sorry I can't even start the bot because of ImportError: cannot import name 'WebSocketClient' from partially initialized module 'interactions.api.gateway.client' (most likely due to a circular import) (C:\Users\edinv\Desktop\PycharmProjects\library\interactions\api\gateway\client.py) 🙂

@Nanrech
Copy link
Contributor

Nanrech commented Mar 31, 2022

Relatable

@i0bs
Copy link
Contributor

i0bs commented Apr 4, 2022

Latest unstable commits have fixed the circular import issue.

@EdVraz
Copy link
Contributor Author

EdVraz commented Apr 5, 2022

@bot.event
async def on_ready():
    print(bot.guilds)
    print(len(bot.guilds))

This results in:

grafik

I don't know what is causing the issue for you

@i0bs
Copy link
Contributor

i0bs commented Apr 5, 2022

Seems that my env was messed up

@EdVraz EdVraz merged commit 5dd14fa into interactions-py:unstable Apr 5, 2022
@EdVraz EdVraz deleted the property branch April 5, 2022 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

None yet

3 participants