EVENT LOOP 已关闭 discord.py,可能出现令牌错误
EVENT LOOP is closed discord.py, possible token error
我查看了有关此问题的其他帖子,但没有找到任何可行的解决方案。我的机器人目前正在进行开发检修,我正在将大量存储的数据(mod 邮件机器人)移动到 aiosqlite 数据库中。在这样做的过程中,我遇到了这个问题。
Traceback (most recent call last):
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 291, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 245, 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 "d:/Programming/AusSea-Bot/main.py", line 225, in <module>
client.run(token())
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 708, in run
return future.result()
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 687, in runner
await self.start(*args, **kwargs)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 650, in start
await self.login(*args, bot=bot)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 499, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 295, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001D4CC4B75E0>
Traceback (most recent call last):
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
为了防止泄露我的令牌,我导入了另一个 python 文件 from Token import token
,其唯一目的是 运行 这行代码 return "token here"
(完整代码 here)
有什么线索吗?我的令牌被取消授权了吗? (我尝试重新制作我的令牌,但它只用了很短的时间)
我的代码完全正确,但我的令牌因不和谐而失效,重做我的令牌修复了它
我查看了有关此问题的其他帖子,但没有找到任何可行的解决方案。我的机器人目前正在进行开发检修,我正在将大量存储的数据(mod 邮件机器人)移动到 aiosqlite 数据库中。在这样做的过程中,我遇到了这个问题。
Traceback (most recent call last):
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 291, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 245, 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 "d:/Programming/AusSea-Bot/main.py", line 225, in <module>
client.run(token())
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 708, in run
return future.result()
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 687, in runner
await self.start(*args, **kwargs)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 650, in start
await self.login(*args, bot=bot)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\client.py", line 499, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\site-packages\discord\http.py", line 295, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000001D4CC4B75E0>
Traceback (most recent call last):
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\Users\L0m\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
为了防止泄露我的令牌,我导入了另一个 python 文件 from Token import token
,其唯一目的是 运行 这行代码 return "token here"
(完整代码 here)
有什么线索吗?我的令牌被取消授权了吗? (我尝试重新制作我的令牌,但它只用了很短的时间)
我的代码完全正确,但我的令牌因不和谐而失效,重做我的令牌修复了它