问题描述
昨天,我的代码非常好.一切都在运行……而且进展顺利.突然,这个错误:
yesterday, my code was perfectly fine. everything was running... and it was going great. all of a sudden, this error:
typeerror: __new__() got an unexpected keyword argument 'deny_new'
在我的 pycharm 控制台中弹出.我已经在互联网上查找过,但我只发现了一个类似的问题,答案为零.我希望stackoverflow社区能够帮助我.我没有更改我的代码,我所做的只是尝试将我的机器人托管在 heroku 上,但进展并不顺利.在我最初的几次尝试之后,我放弃了.但是,我发现我的机器人开始发疯,我无法再运行它了:<.有没有其他人经历过这个并知道如何解决它?更新我刚刚发现由于某种原因,它只能在我的测试服务器上运行,而不能在任何其他服务器上运行.
pops up in my pycharm console. i've looked it up on the internet but i've only found a similiar questions with zero answers to it. i hope the stackoverflow community will be able to help me. i did not change my code, all i did was, i tried to host my bot on heroku, and it did not go well. and after my first few attempts, i gave up. but, i found out my bot started going crazy and i couldn't run it anymore :<. has anyone else experienced this and know how to fix it? update i just found out that for some reason, it only works on my test server but not any other servers.
traceback (most recent call last): file "c:/users/danie/pycharmprojects/skybot/skybotgaming.py", line 21, inclient.run('token') file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordclient.py", line 640, in run return future.result() file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordclient.py", line 621, in runner await self.start(*args, **kwargs) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordclient.py", line 585, in start await self.connect(reconnect=reconnect) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordclient.py", line 499, in connect await self._connect() file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordclient.py", line 463, in _connect await self.ws.poll_event() file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordgateway.py", line 471, in poll_event await self.received_message(msg) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordgateway.py", line 425, in received_message func(data) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordstate.py", line 750, in parse_guild_create guild = self._get_create_guild(data) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordstate.py", line 725, in _get_create_guild guild._from_data(data) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordguild.py", line 297, in _from_data self._sync(guild) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordguild.py", line 328, in _sync self._add_channel(categorychannel(guild=self, data=c, state=self._state)) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordchannel.py", line 726, in __init__ self._update(guild, data) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordchannel.py", line 737, in _update self._fill_overwrites(data) file "c:usersdanieanaconda3envsdiscordbottestlibsite-packagesdiscordabc.py", line 294, in _fill_overwrites self._overwrites.append(_overwrites(id=overridden_id, **overridden)) typeerror: __new__() got an unexpected keyword argument 'deny_new'
我用不同的文件和机器人尝试了它,得到了相同的结果,这就像 discord.py 的问题.这实际上是我的全部代码
i tried it with a different file and bot and i got the same results, this is like a problem with discord.py. this is literally my entire code
import discord import random from discord.ext import commands import asyncio client = commands.bot(command_prefix='{') client.remove_command('help') @client.event async def on_ready(): print("signed in") @client.command() async def dm(ctx): await ctx.author.send("what up chump?") client.run('token')
推荐答案
discord 推送了一个新的更改,该更改更改了覆盖对象.
discord pushed a new change that changes the overwrites object.
只需重新安装最新版本的 discord.py
just reinstall the latest version of discord.py
python3 -m pip install -u discord.py
就是这样.