Python TypeError:uuu new_uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;否认新的';
希望你能帮我解决一个意想不到的新问题 直到昨天,一切都很正常,然后机器人离线,我登录Heroku查看日志,请参见下面。我在Python方面没有太多经验,但从日志中可以看出,这一定是一个discord.py问题。有人有什么想法吗Python TypeError:uuu new_uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;否认新的';,python,heroku,discord,discord.py,Python,Heroku,Discord,Discord.py,希望你能帮我解决一个意想不到的新问题 直到昨天,一切都很正常,然后机器人离线,我登录Heroku查看日志,请参见下面。我在Python方面没有太多经验,但从日志中可以看出,这一定是一个discord.py问题。有人有什么想法吗 import os import discord import asyncio import giphypop from discord.ext import commands key = os.environ['TOKEN'] PREFIX = ">&
import os
import discord
import asyncio
import giphypop
from discord.ext import commands
key = os.environ['TOKEN']
PREFIX = ">"
#CREATE THE BOT INSTANCE
bot = commands.Bot(command_prefix=PREFIX, self_bot=True)
###################
# C O M M A N D S #
###################
#@bot.command(pass_context=True, aliases=['g'])
#async def game(ctx, *args):
#if args:
#cstatus = ctx.message.server.get_member(bot.user.id).status
#txt = " ".join(args)
#await bot.change_presence(game=Game(name=txt), status=cstatus)
#msg = await bot.send_message(ctx.message.channel, embed=Embed(color=Color.green(), description="Changed game to `%s`!" % txt))
#else:
#await bot.change_presence(game=None, status=cstatus)
#msg = await bot.send_message(ctx.message.channel, embed=Embed(color=Color.gold(), description="Disabled game display."))
#await bot.delete_message(ctx.message)
#await asyncio.sleep(3)
#await bot.delete_message(msg)
@bot.command(pass_context=True, aliases=['s'])
async def status(ctx, *args):
stati = {
"on": Status.online,
"online": Status.online,
"off": Status.invisible,
"offline": Status.invisible,
"dnd": Status.dnd,
"idle": Status.idle,
"afk": Status.idle
}
if args:
cgame = ctx.message.server.get_member(bot.user.id).game
if (args[0] in stati):
if (args[0] == "afk"):
await bot.change_presence(game=cgame, status=Status.idle, afk=True)
else:
await bot.change_presence(game=cgame, status=stati[args[0]], afk=False)
print(stati[args[0]])
msg = await bot.send_message(ctx.message.channel, embed=Embed(description="Changed current status to `%s`." % args[0], color=Color.gold()))
else:
await bot.change_presence(game=cgame, status=Status.online, afk=False)
msg = await bot.send_message(ctx.message.channel, embed=Embed(description="Changed current status to `online`.", color=Color.gold()))
await bot.delete_message(ctx.message)
await asyncio.sleep(3)
await bot.delete_message(msg)
bot.run(key, bot=False)
这是日志
2020-07-23T13:08:49.359275+00:00 app[worker.1]: Traceback (most recent call last):
2020-07-23T13:08:49.359440+00:00 app[worker.1]: File "main.py", line 58, in <module>
2020-07-23T13:08:49.359799+00:00 app[worker.1]: bot.run(key, bot=False)
2020-07-23T13:08:49.359803+00:00 app[worker.1]: File "/app/discord/client.py", line 519, in run
2020-07-23T13:08:49.360182+00:00 app[worker.1]: self.loop.run_until_complete(self.start(*args, **kwargs))
2020-07-23T13:08:49.360186+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/asyncio/base_events.py", line 488, in run_until_complete
2020-07-23T13:08:49.360490+00:00 app[worker.1]: return future.result()
2020-07-23T13:08:49.360490+00:00 app[worker.1]: File "/app/discord/client.py", line 491, in start
2020-07-23T13:08:49.360873+00:00 app[worker.1]: yield from self.connect()
2020-07-23T13:08:49.360918+00:00 app[worker.1]: File "/app/discord/client.py", line 448, in connect
2020-07-23T13:08:49.361184+00:00 app[worker.1]: yield from self.ws.poll_event()
2020-07-23T13:08:49.361226+00:00 app[worker.1]: File "/app/discord/gateway.py", line 431, in poll_event
2020-07-23T13:08:49.361574+00:00 app[worker.1]: yield from self.received_message(msg)
2020-07-23T13:08:49.361578+00:00 app[worker.1]: File "/app/discord/gateway.py", line 390, in received_message
2020-07-23T13:08:49.361891+00:00 app[worker.1]: func(data)
2020-07-23T13:08:49.361955+00:00 app[worker.1]: File "/app/discord/state.py", line 215, in parse_ready
2020-07-23T13:08:49.362183+00:00 app[worker.1]: server = self._add_server_from_data(guild)
2020-07-23T13:08:49.362188+00:00 app[worker.1]: File "/app/discord/state.py", line 156, in _add_server_from_data
2020-07-23T13:08:49.362395+00:00 app[worker.1]: server = Server(**guild)
2020-07-23T13:08:49.362396+00:00 app[worker.1]: File "/app/discord/server.py", line 121, in __init__
2020-07-23T13:08:49.362549+00:00 app[worker.1]: self._from_data(kwargs)
2020-07-23T13:08:49.362552+00:00 app[worker.1]: File "/app/discord/server.py", line 218, in _from_data
2020-07-23T13:08:49.362764+00:00 app[worker.1]: self._sync(guild)
2020-07-23T13:08:49.362768+00:00 app[worker.1]: File "/app/discord/server.py", line 250, in _sync
2020-07-23T13:08:49.363073+00:00 app[worker.1]: channel = Channel(server=self, **c)
2020-07-23T13:08:49.363111+00:00 app[worker.1]: File "/app/discord/channel.py", line 89, in __init__
2020-07-23T13:08:49.363350+00:00 app[worker.1]: self._update(**kwargs)
2020-07-23T13:08:49.363387+00:00 app[worker.1]: File "/app/discord/channel.py", line 116, in _update
2020-07-23T13:08:49.363608+00:00 app[worker.1]: self._permission_overwrites.append(Overwrites(**overridden))
2020-07-23T13:08:49.363655+00:00 app[worker.1]: TypeError: __new__() got an unexpected keyword argument 'deny_new'.
2020-07-23T13:08:49.359275+00:00应用程序[工人1]:回溯(最近一次呼叫):
2020-07-23T13:08:49.359440+00:00应用程序[worker.1]:文件“main.py”,第58行,在
2020-07-23T13:08:49.359799+00:00应用程序[工人1]:机器人运行(键,机器人=False)
2020-07-23T13:08:49.359803+00:00应用程序[工人1]:文件“/app/discord/client.py”,第519行,运行中
2020-07-23T13:08:49.360182+00:00应用程序[工人1]:自循环运行直到完成(自启动(*args,**kwargs))
2020-07-23T13:08:49.360186+00:00应用程序[worker.1]:文件“/app/.heroku/python/lib/python3.6/asyncio/base\u events.py”,第488行,运行直到完成
2020-07-23T13:08:49.360490+00:00应用程序[工人1]:返回未来结果()
2020-07-23T13:08:49.360490+00:00应用程序[worker.1]:文件“/app/discord/client.py”,第491行,在开始处
2020-07-23T13:08:49.360873+00:00应用程序[工人1]:自我连接的收益()
2020-07-23T13:08:49.360918+00:00应用程序[worker.1]:文件“/app/discord/client.py”,第448行,在connect中
2020-07-23T13:08:49.361184+00:00应用程序[工人1]:self.ws.poll_事件的收益率()
2020-07-23T13:08:49.361226+00:00应用程序[worker.1]:文件“/app/discord/gateway.py”,第431行,在轮询事件中
2020-07-23T13:08:49.361574+00:00应用程序[工人1]:从自我接收的信息(msg)中获得收益
2020-07-23T13:08:49.361578+00:00应用程序[worker.1]:文件“/app/discord/gateway.py”,第390行,在收到的消息中
2020-07-23T13:08:49.361891+00:00应用程序[工人1]:函数(数据)
2020-07-23T13:08:49.361955+00:00应用程序[worker.1]:文件“/app/discord/state.py”,第215行,在parse_ready中
2020-07-23T13:08:49.362183+00:00应用程序[工人1]:服务器=self.\u从数据(公会)添加服务器\u
2020-07-23T13:08:49.362188+00:00应用程序[worker.1]:文件“/app/discord/state.py”,第156行,从数据添加服务器
2020-07-23T13:08:49.362395+00:00应用程序[工人1]:服务器=服务器(**工会)
2020-07-23T13:08:49.362396+00:00应用程序[worker.1]:文件“/app/discord/server.py”,第121行,在__
2020-07-23T13:08:49.362549+00:00应用程序[工人1]:来自数据(kwargs)的自我
2020-07-23T13:08:49.362552+00:00应用程序[worker.1]:文件“/app/discord/server.py”,第218行,从数据中输入
2020-07-23T13:08:49.362764+00:00应用程序[工人1]:自我同步(公会)
2020-07-23T13:08:49.362768+00:00应用程序[工人1]:文件“/app/discord/server.py”,第250行,同步
2020-07-23T13:08:49.363073+00:00应用程序[工人1]:频道=频道(服务器=自身,**c)
2020-07-23T13:08:49.363111+00:00应用程序[worker.1]:文件“/app/discord/channel.py”,第89行,在__
2020-07-23T13:08:49.363350+00:00应用程序[工人1]:自我更新(**kwargs)
2020-07-23T13:08:49.363387+00:00应用程序[工人1]:文件“/app/discord/channel.py”,第116行,在更新中
2020-07-23T13:08:49.363608+00:00应用程序[工人1]:自我权限覆盖附加(覆盖(**覆盖))
2020-07-23T13:08:49.363655+00:00应用程序[worker.1]:TypeError:\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu。
replicate of此选项是否回答了您的问题?不,这一点都没有帮助,我尝试了通过命令python3-mpipinstall-U discord.py更新,但仍然是相同的问题!试着写一个重复的pip unstall-U discord
?不,这一点都没有帮助,我尝试了通过命令python3-mpipinstall-U discord.py更新,但仍然是相同的问题!尝试编写pip unstall-U discord