擅长:python、mysql、java
<p>你也许可以有一个方法来解释他们发布的整个消息来触发命令?在</p>
<pre><code>@bot.event
async def on_message(ctx): # compute every message, not just commands
message_being_interpreted = ctx.content.lower()
print(message_being_interpreted ) # will print all messages
# do things to parse it like this
if "!guess" in message_being_interpreted:
pass # or do stuff
</code></pre>
<p>如果用户应该像<code>!guess 17463</code>那样为参数提供命令,这将非常有效,但是您也可以让它这样用户只需键入一个猜测,比如<code>17463</code>,然后当他们输入正确的猜测时,它会触发一些事件。在</p>