PumPum7 / Tatsu.py

A async python api wrapper for the tatsu API (https://dev.tatsu.gg/)
MIT License
3 stars 1 forks source link

object has no attribute 'credits' #4

Open hieupham1103 opened 2 years ago

hieupham1103 commented 2 years ago

I use Tatsu API to get user's credit, but it has problem is 'object has no attribute 'credits''. It also appears when I use avatar_url, avatar_hash,...

@commands.command()
    async def transfer(self,ctx, member: discord.Member):
      wrapper = ApiWrapper(key=os.environ['token'])
      user_profile = await wrapper.get_profile(member.id)
      await ctx.send(user_profile.credits)
PumPum7 commented 2 years ago

I can not reproduce this error. Can you send me the user id of a user where it happens?

This is the code i used:

@pytest.mark.asyncio
async def test_get_profile():
    wrapper = tatsu.wrapper.ApiWrapper(key=APIKEY)
    result = await wrapper.get_profile(274561812664549376)
    print(result.credits)
    assert result.credits is not None