JonnyPtn / zomboi

A discord bot for project zomboid multiplayer servers
49 stars 32 forks source link

Chat stops working #54

Closed 6-- closed 1 year ago

6-- commented 1 year ago

Hey!

Chat stops mirroring after 10 mins or so, everything else works fine

Any idea whats causing it?

Thanks!

JonnyPtn commented 1 year ago

Do you get any error log/output? I would guess there's an unhandled exception in the cog which stops it from running

thurbridi commented 1 year ago

Don't know if it's related but in line 69 of chat.py I got an exception when trying to get the avatar URL. 2022-10-13 18:41:32 ERROR discord.ext.tasks Unhandled exception in internal background task 'update'. Traceback (most recent call last): File "/home/casper/zomboi/.venv/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop await self.coro(*args, **kwargs) File "/home/casper/zomboi/chat.py", line 40, in update await self.handleLog(timestamp, message) File "/home/casper/zomboi/chat.py", line 69, in handleLog avatar_url = member.avatar_url AttributeError: 'Member' object has no attribute 'avatar_url'

Changing it the following fixed the problem: avatar_url = member.avatar.url

JonnyPtn commented 1 year ago

Ah yep that'll be it - thanks. I guess it changed in discord.py 2.0 but I missed it when upgrading. Will fix shortly

WorkingClassKid commented 1 year ago

Change line 69 in chat.py

avatar_url = member.avatar_url

TO

avatar_url = member.display_avatar

solved the problem for me

JonnyPtn commented 1 year ago

Believe this should be fixed now