'discord on_message fixing python

On my function async for msg in ctx.channel.history(limit=1): in the on_message event I get this error:

discord.errors.HTTPException: 524  (error code: 0): <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->```

And then it shows a loooonng html code...


Solution 1:[1]

The 524 error is a server timeout error. This means that there is a problem with your computer (or host) and discord.

To fix this, try:

  • restarting your computer
  • clearing the DNS cache
  • running your bot on a virtual environment

If none of these work try going to https://discord.com and seeing if it'll connect.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wotanut