Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/301.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
_ready()上的异步定义:需要Discord bot Python疑难解答_Python_Discord_Discord.py - Fatal编程技术网

_ready()上的异步定义:需要Discord bot Python疑难解答

_ready()上的异步定义:需要Discord bot Python疑难解答,python,discord,discord.py,Python,Discord,Discord.py,我试图为我的python代码解决这个问题,但我还没有解决它。有人能帮忙吗 @client.event async def on_ready(): await client.change_presence(game=discord.Game(name=data['BotStatus'])) print('bruh idek why im using python') @client.command(pass_context=True) async def redeem(ctx,

我试图为我的python代码解决这个问题,但我还没有解决它。有人能帮忙吗

@client.event
async def on_ready():
    await client.change_presence(game=discord.Game(name=data['BotStatus']))
    print('bruh idek why im using python')

@client.command(pass_context=True)
async def redeem(ctx, arg1, arg2, arg3):
    await client.delete_message(ctx.message)
    allowed_countries = [
     'US', 'GB', 'DE', 'CA', 'AU', 'IT', 'NZ', 'MX', 'BE', 'FR', 'ID', 'SG', 'BR', 'MY', 'PT', 'IL', 'DK', 'NL', 'ES', 'SE', 'NO', 'TR']
当我运行脚本时。这就是我得到的

我目前正在使用Python 2.7.10。如果有人能帮我解决这个问题,它将在许多方面帮助我

文件“bot.py”,第173行 _ready()上的异步定义: ^

需要Python 3.5.3或更高版本。它不能在Python2上运行。见

py适用于Python 3.5.3或更高版本。不提供对Python早期版本的支持。不支持Python 2.7或更低版本。由于一个依赖项()不支持Python 3.4,因此不支持Python 3.4或更低版本

需要Python 3.5.3或更高版本。它不能在Python2上运行。见

py适用于Python 3.5.3或更高版本。不提供对Python早期版本的支持。不支持Python 2.7或更低版本。由于一个依赖项()不支持Python 3.4,因此不支持Python 3.4或更低版本


尝试升级到Python3.6.8,对我来说很好。

尝试升级到Python3.6.8,对我来说很好。

代码太多了,没有人会读到这篇文章,请给出一个最小的(可重复的)例子来说明问题,同时指出第173行^^并给出完整的堆栈跟踪,你没有理解^编辑你的帖子,切勿在评论中添加重要信息;)哦好啊非常感谢。代码太多了,没有人会读这篇文章,请给出一个最小的(可复制的)例子来说明问题,同时指出第173行^^^^并给出完整的stacktrace,您没有给出任何要理解的内容^^^编辑您的文章,永远不要在评论中添加重要信息;)哦好啊非常感谢。