tetsuya-ki / discord-live-notificationbot

discordでライブ配信などを通知するBotです(ニコニコ生放送, YouTubeのみ対応)
MIT License
8 stars 3 forks source link

Embedが長すぎてエラーになることがある #6

Closed tetsuya-ki closed 2 years ago

tetsuya-ki commented 2 years ago
2021-12-22 11:17:28,354@ asyncio [ERROR] default_exception_handler: Task exception was never retrieved
future: <Task finished name='Task-2263' coro=<Loop._loop() done, defined at /opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/tasks/__init__.py:88> exception=HTTPException('400 Bad Request (error code: 50035): Invalid Form Body\nIn embed.description: Must be 4096 or fewer in length.')>
Traceback (most recent call last):
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 125, in _loop
    raise exc
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/ext/tasks/__init__.py", line 101, in _loop
    await self.coro(*args, **kwargs)
  File "/home/runner/discord-live-notificationbot/cogs/livenotificationcog.py", line 113, in printer
    await channel.send(f'{mention} {message}', embed=embed)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/dpy_overrides.py", line 323, in send_override
    return await send(channel, *args, **kwargs)
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord_slash/dpy_overrides.py", line 300, in send
    data = await state.http.send_message(
  File "/opt/virtualenvs/python3/lib/python3.8/site-packages/discord/http.py", line 254, in request
    raise HTTPException(r, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body
In embed.description: Must be 4096 or fewer in length.