bearer_client.users.get_my_guilds() is almost all empty
Closed this issue · 4 comments
Hello there!
I have recently discovered your module and I hope you are still around to answer some question after so long.
I'm been using this piece of code to retrieve the current user information (The one logged in through Oauth) as well as one of his guilds information.
Unfortunately, it seems to return only basic information about the guild as most of the returned value are set to None
. Do you have any idea why? Is it a change in the API? Is it me doing something wrong?
Here's the code:
bearer_client = APIClient(session.get('token'), bearer=True)
current_user = bearer_client.users.get_current_user()
user_guilds = bearer_client.users.get_my_guilds()
myguild_info = next(
(guild for guild in user_guilds if guild.name == 'MyGuildName'),
None
)
And here is the result:
Guild(channels = "None", description = "None", discovery_splash = "None", emojis = "[]", features = "['TEXT_IN_VOICE_ENABLED',
'NEWS', 'INVITE_SPLASH', 'COMMUNITY', 'MEMBER_PROFILES', 'BANNER', 'ROLE_ICONS', 'WELCOME_SCREEN_ENABLED',
'SEVEN_DAY_THREAD_ARCHIVE', 'PRIVATE_THREADS', 'ANIMATED_BANNER', 'APPLICATION_COMMAND_PERMISSIONS_V2',
'PREVIEW_ENABLED', 'MEMBER_VERIFICATION_GATE_ENABLED', 'ANIMATED_ICON', 'THREADS_ENABLED', 'VANITY_URL',
'THREE_DAY_THREAD_ARCHIVE', 'AUTO_MODERATION']
", icon="someID",
icon_url = "someURL",
id = "someID", is_owner = "False", joined_at = "None", large = "None", max_members = "None", max_presences = "None",
member_count = "None", members = "None", mfa_level = "None", name = "Iron Stars", nsfw_level = "None", owner = "False",
owner_id = "None", permissions = "someID", presences = "None", region = "None", roles = "None", splash = "None",
threads = "None", unavailable = "False", vanity_url_code = "None", verification_level = "None", widget_channel_id = "None",
widget_enabled = "None")
```
Hello. I am very very sorry for not replying earlier, I was pretty busy with school stuff so I was on a break from coding and development on Zenora especially.
Regarding this issue, I have No idea. I wonder why this is happening. The code for the get_my_guilds()
method is nothing too complicated and there isn't much going on.
def get_my_guilds(self) -> List[Guild]:
url = BASE_URL + GET_USER_GUILDS
payload = Request.make_request(
self._token,
url,
"GET",
)
return [deserialize_model(Guild, i) for i in payload]
Maybe it could be an issue with the model deserializer, but all it does is unpacks the response dictionary into the attr.s
object. I will have to take a look at this as soon as I'm done with my exams. Have you tried debugging it before posting the issue here? If you have done any research into it, kindly let me know.
Hello,
No worries about the late reply. IRL comes always first, especially when related to school. :)
I have done zero debugging as I'm all new with Python. I'm even impressed I could get this working so quickly by following your video.
And on top of that, IRL has taken over me as well so I have put my project on hold. ^^
So no rush needed.
Have you tried not going through the data and exposing it raw? It will help narrow down the issue
Hey,
Thanks for coming back toward me about this. I have shelved this project at the moment so there's been no new work on it from me. I guess we can close the issue. :)