0

特定の @role のすべてのメンバーを不一致チャネルに出力する (最初の) ボットにコマンドを書き込もうとしています (この場合は「Serf」と呼ばれます)。これは私のコマンド/関数です。

@client.command()
async def snap(ctx):
    target = discord.Role.members("Serf")
    for person in target:
        await ctx.send(person)

しかし、何も起こらず、ターミナルでこのエラーが発生します

Ignoring exception in command snap:
Traceback (most recent call last):
  File "/home/thonkpad/.local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 83, in wrapped
    ret = await coro(*args, **kwargs)
  File "Python/thanosBot/bot.py", line 28, in snap
    target = discord.Role.members("Serf")
TypeError: 'property' object is not callable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/thonkpad/.local/lib/python3.7/site-packages/discord/ext/commands/bot.py", line 892, in invoke
    await ctx.command.invoke(ctx)
  File "/home/thonkpad/.local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 797, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "/home/thonkpad/.local/lib/python3.7/site-packages/discord/ext/commands/core.py", line 92, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: 'property' object is not callable
4

1 に答える 1