title: discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
body: <p>This is the huge error im getting:</p>
  <pre><code>Traceback (most recent call last):
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\http.py&quot;, line 349, in static_login
      data = await self.request(Route('GET', '/users/@me'))
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\http.py&quot;, line 302, in request
      raise HTTPException(r, data)
  discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
    File &quot;f:\Programming\Python\Discord bot\LastOneEverythingCombined\TEST.py&quot;, line 112, in &lt;module&gt;
      client.run('OTA0NjMxMzE2MzU0NTg4NzEz.YX-VkQ._B-EnQRE3IhWYl0psJA8UxZuI6s')
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\client.py&quot;, line 631, in run
      return future.result()
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\client.py&quot;, line 610, in runner
      await self.start(*args, **kwargs)
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\client.py&quot;, line 573, in start
      await self.login(*args)
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\client.py&quot;, line 424, in login
      await self.http.static_login(token.strip())
    File &quot;C:\Users\User\AppData\Roaming\Python\Python310\site-packages\discord\http.py&quot;, line 353, in static_login
      raise LoginFailure('Improper token has been passed.') from exc
  discord.errors.LoginFailure: Improper token has been passed.
  Exception ignored in: &lt;function _ProactorBasePipeTransport.__del__ at 0x000001B4F30E1EA0&gt;
  Traceback (most recent call last):
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py&quot;, line 116, in __del__
      self.close()
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py&quot;, line 108, in close
      self._loop.call_soon(self._call_connection_lost, None)
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py&quot;, line 745, in call_soon
      self._check_closed()
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py&quot;, line 510, in _check_closed
      raise RuntimeError('Event loop is closed')
  RuntimeError: Event loop is closed
  Exception ignored in: &lt;function _ProactorBasePipeTransport.__del__ at 0x000001B4F30E1EA0&gt;
  Traceback (most recent call last):
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py&quot;, line 116, in __del__
      self.close()
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py&quot;, line 108, in close
      self._loop.call_soon(self._call_connection_lost, None)
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py&quot;, line 745, in call_soon
      self._check_closed()
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py&quot;, line 510, in _check_closed
      raise RuntimeError('Event loop is closed')
  RuntimeError: Event loop is closed
  Exception ignored in: &lt;function _ProactorBasePipeTransport.__del__ at 0x000001B4F30E1EA0&gt;
  Traceback (most recent call last):
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py&quot;, line 116, in __del__
      self.close()
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\proactor_events.py&quot;, line 108, in close
      self._loop.call_soon(self._call_connection_lost, None)
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py&quot;, line 745, in call_soon
      self._check_closed()
    File &quot;C:\Users\User\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py&quot;, line 510, in _check_closed
      raise RuntimeError('Event loop is closed')
  RuntimeError: Event loop is closed
  </code></pre>
  <p>I have no clue how to fix it and have tried everything on the web
  This is my code: in the spot of Token i have my token but ofcourse lets keep it hidden :)</p>
  <pre><code>client = commands.Bot(command_prefix='.')
  Code....
  client.run('Token')
  </code></pre>
  <p>Last time i put my entire code there and people got mad so i am now just putting the code i think might be necessary for this problem, if you need any other bits of code just reply with i need all the code to solve this error or more code and then the specific bit that you need or think might be in it</p>