Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.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
如何降低响应discord.py的大小写_Discord.py - Fatal编程技术网

如何降低响应discord.py的大小写

如何降低响应discord.py的大小写,discord.py,Discord.py,所以基本上,这个人是在猜测这部动画片的名字!我想让它做的是把这个案子的句子化!我该怎么做?代码如下: @client.command() async def work(ctx): await open_account(ctx.author) users = await get_bank_data() user = ctx.author def check(m): return m.author.id == ctx.author.id Que

所以基本上,这个人是在猜测这部动画片的名字!我想让它做的是把这个案子的句子化!我该怎么做?代码如下:

@client.command()
async def work(ctx):
    await open_account(ctx.author)
    users = await get_bank_data()
    user = ctx.author
    def check(m):
        return m.author.id == ctx.author.id
    Question1 = 'https://upload.wikimedia.org/wikipedia/en/thumb/d/dc/DARLING_in_the_FRANXX%2C_second_key_visual.jpg/220px-DARLING_in_the_FRANXX%2C_second_key_visual.jpg'
    Question2 = 'http://www.j1studios.com/wordpress/wp-content/uploads/Trinity-Seven-Header-001-20160707.jpg'
    Question3 = 'https://www.animenewsnetwork.com/hotlink/images/encyc/A18170-2511174083.1466822675.jpg'
    Question4 = 'https://www.animenewsnetwork.com/hotlink/images/encyc/A16344-911899268.1425205899.jpg'
    Question5 = 'https://www.theanimedaily.com/wp-content/uploads/2020/06/20061004422210.jpg'
    Question6 = 'https://th.bing.com/th/id/OIP.zvtbvP4JZNrrlAKPnclMpwHaEK?pid=Api&rs=1&adlt=strict'
    Question7 = 'https://mangathrill.com/wp-content/uploads/2020/01/pjimage-1-4.jpg'
    Question8 = 'https://th.bing.com/th/id/OIP.xV_2srfdOhEre9Vua-u6zAHaFb?pid=Api&rs=1&adlt=strict'
    Question9 = 'https://img1.looper.com/img/gallery/the-untold-truth-of-hunter-x-hunter/intro-1591800144.jpg'
    Question10 = 'https://i1.wp.com/static.anidub.com/blog/2014/09/Seirei-Tsukai-no-Blade-Dance.jpg'
    questionlist = [Question1, Question2, Question3, Question4, Question5, Question6, Question7, Question8, Question9, Question10]
    question = random.choice(questionlist)
    await ctx.send("What is the title name of this anime?")
    await asyncio.sleep(1)
    await ctx.send(question)
    msg = await client.wait_for('message', check=check)
    await msg.lower()
    if question == Question1:
        if msg.content == "darling in the franxx":
            earnings = random.randrange(300, 500)
            await ctx.send(f"You did good! You got an earning of **{earnings}** coins!")
        else:
            earnings = random.randrange(0, 200)
            await ctx.send(f"Did you even try? You got **{earnings}** coins!")

msg=wait client.wait_for('message',check=check)
返回
discord.message类。和
discord.Message
没有属性
lower()
。但是它有
内容
内容
返回消息的字符串值

另外,
await msg.lower()
是一个奇怪的用法,它不是一个协同程序,所以你不能
await

因此,您可以简单地执行以下操作:

msg=wait client.wait_for('message',check=check)
msg_content=msg.content.lower()
如果问题==问题1:
如果msg_content==“franxx中的达令”:
收益=随机。随机范围(300500)
等待ctx.send(f“你做得很好!你得到了**{earnings}**硬币!”
其他:
收益=随机。随机范围(0,200)
等待ctx.send(f“你试过了吗?你得到了**{earnings}**硬币!”
另外,我建议你们把问题和问题列表放到命令之外,它会变得更加优化