vlourme / vintedpy

Get alerted on Discord when new Vinted articles are published 🛒
GNU General Public License v3.0
29 stars 9 forks source link

error #2

Closed HyperBeats closed 2 years ago

HyperBeats commented 2 years ago

Hello, I have this error that occurs when the bot works

E 2022-03-04 11:16:13,500 asyncio: Task exception was never retrieved future: <Task finished name='Task-16' coro=<run_background() done, defined at /home/container/main.py:18> exception=TypeError('in embed.fields[1].value - cannot have empty string')> Traceback (most recent call last): File "/home/container/main.py", line 27, in run_background await bot.rest.create_message(sub['channel_id'], embed=embed, components=[row]) File "/home/container/.local/lib/python3.10/site-packages/hikari/impl/rest.py", line 1365, in create_message body, form = self._build_message_payload( File "/home/container/.local/lib/python3.10/site-packages/hikari/impl/rest.py", line 1301, in _build_message_payload embed_payload, embed_attachments = self._entity_factory.serialize_embed(embed) File "/home/container/.local/lib/python3.10/site-packages/hikari/impl/entity_factory.py", line 1040, in serialize_embed raise TypeError(f"in embed.fields[{i}].value - cannot have empty string") TypeError: in embed.fields[1].value - cannot have empty string

vlourme commented 2 years ago

Hi, seems like the API respond with empty values sometimes. I didn't got this error so far. I'll make a patch during the day

vlourme commented 2 years ago

I just made a small patch to handle null or empty values. If it still does not work, you can post the subscription URL here (or email me if private: vlourme@icloud.com).