interactions-py / interactions.py

A highly extensible, easy to use, and feature complete bot framework for Discord
https://interactions-py.github.io/interactions.py/
MIT License
840 stars 185 forks source link

[BUG] Crash on start-up suddenly happening despite no change to code #1738

Open jc-360 opened 2 months ago

jc-360 commented 2 months ago

Library Version

5.13.2

Describe the Bug

In the last 2 days or so, I have not been able to run my bot as it immediately crashes on start-up despite no change to the code in several weeks. The error appears to be within the library's user.py file, as shown in the traceback below.

Steps to Reproduce

This error occurs every time I attempt to run my bot.

Expected Results

I would expect my bot to run as normal.

Minimal Reproducible Code

No response

Traceback

Traceback (most recent call last):
  File "/home/container/main.py", line 273, in <module>
    bot.start("Hidden token")
  File "/home/container/.local/lib/python3.10/site-packages/interactions/client/client.py", line 1008, in start
    asyncio.run(self.astart(token))
  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/container/.local/lib/python3.10/site-packages/interactions/client/client.py", line 964, in astart
    await self.login(token)
  File "/home/container/.local/lib/python3.10/site-packages/interactions/client/client.py", line 946, in login
    self._user = ClientUser.from_dict(me, self)
  File "/home/container/.local/lib/python3.10/site-packages/interactions/models/discord/base.py", line 36, in from_dict
    data = cls._process_dict(data, client)
  File "/home/container/.local/lib/python3.10/site-packages/interactions/models/discord/user.py", line 170, in _process_dict
    data = super()._process_dict(data, client)
  File "/home/container/.local/lib/python3.10/site-packages/interactions/models/discord/user.py", line 64, in _process_dict
    if not isinstance(data["avatar"], Asset):
TypeError: 'NoneType' object is not subscriptable
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f962c7a90f0>

Checklist

Additional Information

No response

AstreaTSS commented 2 months ago

This seemingly implies that the /user/@me endpoint was returning nothing, which is... strange. I certainly can't reproduce it. If anyone else has this issue, please do respond.

jc-360 commented 2 months ago

This seemingly implies that the /user/@me endpoint was returning nothing, which is... strange. I certainly can't reproduce it. If anyone else has this issue, please do respond.

I believe you are correct, as above the traceback (I should perhaps have included it) is the following:

GET /users/@me Has exceeded its ratelimit (1)! Reset in 0.0 seconds
GET /users/@me Has exceeded its ratelimit (1)! Reset in 0.0 seconds
GET /users/@me Has exceeded its ratelimit (1)! Reset in 0.0 seconds