Discord.py missing required argument

前端 未结 1 1422
既然无缘
既然无缘 2020-12-07 05:08

I have a rewrite version discord.py.If message have content, error does not happened.I need that error does not happened if message have not content.

My code:

<
相关标签:
1条回答
  • 2020-12-07 05:47

    The way commands parse arguments means that defining

    async def search(ctx, message):
    

    means that search requires a word message as part of the command invocation. If you instead want to capture the remainder of the message, you can use the keyword-only argument syntax:

    async def search(ctx, *, message)
    

    This feature is documented here.

    0 讨论(0)
提交回复
热议问题