擅长:python、mysql、java
<p>您只需在消息事件上运行此命令:</p>
<pre class="lang-js prettyprint-override"><code>if(!message.author.user.bot) return; //not the exact code
</code></pre>
<p>因为消息事件可以<code>return</code>用户,并且用户具有默认的<a href="http://discordpy.readthedocs.io/en/latest/api.html#discord.User.bot" rel="nofollow noreferrer">bot check</a>。<code>message.author</code>返回一个成员,因此您可以调用<a href="http://discordpy.readthedocs.io/en/latest/api.html#discord.Message.author" rel="nofollow noreferrer">member</a>的<code>user</code>对象,然后像我上面所做的那样执行检查。</p>
<p><strong>伪码:</strong></p>
<pre><code>If the author of the message (user) is a bot: return;
This will prevent an infinite loop from occuring
</code></pre>