Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.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,我需要一种方法来检查某个用户是否自我保护。我知道有.selfdead,但我不知道如何将其放入命令中,它需要是客户端.event命令,为了便于访问,它应该返回一个布尔值。有人能帮我吗?这是一个使用命令装饰器的基本示例 @client.command() 异步def isdeaf(ctx,用户:discord.Member): 如果user.voice: 如果user.voice.self\u耳聋: 等待ctx.send(f“{user}自己聋了!”) 其他: wait ctx.send(f“{us

我需要一种方法来检查某个用户是否自我保护。我知道有
.selfdead
,但我不知道如何将其放入命令中,它需要是
客户端.event
命令,为了便于访问,它应该返回一个布尔值。有人能帮我吗?

这是一个使用命令装饰器的基本示例

@client.command()
异步def isdeaf(ctx,用户:discord.Member):
如果user.voice:
如果user.voice.self\u耳聋:
等待ctx.send(f“{user}自己聋了!”)
其他:
wait ctx.send(f“{user}当前不在语音频道中。”)

参考文献:


    • 下面是一个使用命令装饰器的基本示例

      @client.command()
      异步def isdeaf(ctx,用户:discord.Member):
      如果user.voice:
      如果user.voice.self\u耳聋:
      等待ctx.send(f“{user}自己聋了!”)
      其他:
      wait ctx.send(f“{user}当前不在语音频道中。”)
      

      参考文献: