擅长:python、mysql、java
<p>没关系,我终于明白了。对那些有同样问题的人</p>
<pre><code>if message.author == client.user:
return
if message.author.bot: return
</code></pre>
<p>对代码和它的工作,所以我的现在看起来像这样:</p>
<pre><code>@client.event
async def on_message(message):
# we do not want the bot to reply to itself
if message.author == client.user:
return
if message.author.bot: return
if message.content.startswith('k'):
msg = 'k'.format(message)
await client.send_message(message.channel, msg)
</code></pre>