k8thekat / GatekeeperV2

Update to Gatekeeper
GNU General Public License v3.0
27 stars 11 forks source link

discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message #52

Closed Acheronx98 closed 1 year ago

Acheronx98 commented 1 year ago

After running /server display in one of the channels that the bot has permissions to, I'm getting the following error and then the banner no longer gets updated. It appears like the 1-minute loop completely stops and only restarts when I run the command again, but clearly that's not what's supposed to happen.

12/21/2022 02:44:05 PM [MainThread] [INFO]  Updating Server Display Messages
12/21/2022 02:44:13 PM [MainThread] [ERROR]  Unhandled exception in internal background task 'server_display_update'.
Traceback (most recent call last):
  File "/home/amp/.local/lib/python3.10/site-packages/discord/ext/tasks/__init__.py", line 239, in _loop
    await self.coro(*args, **kwargs)
  File "/home/amp/Gatekeeper-Bot/cogs/AMP_server_cog.py", line 171, in server_display_update
    await self._embed_generator(message_list, discord_guild, discord_channel)
  File "/home/amp/Gatekeeper-Bot/cogs/AMP_server_cog.py", line 116, in _embed_generator
    await message_list[curpos].edit(embeds=embed_list[curpos*10:(curpos+1)*10])
  File "/home/amp/.local/lib/python3.10/site-packages/discord/message.py", line 929, in edit
    data = await self._state.http.edit_message(self.channel.id, self.id, params=params)
  File "/home/amp/.local/lib/python3.10/site-packages/discord/http.py", line 744, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message
k8thekat commented 1 year ago

This issue will be addressed in the upcoming update I am releasing. Should be within a week.

Thank you for the report.

k8thekat commented 1 year ago

This issue was fixed in 4.4.0