title: Discord bot that counts the amount of messages sent in a channel
body: <p>I am trying to code a bot in discord that counts the amount of messages sent in total by a user. This is my code:</p>
  <pre><code>import discord
  
  
  client = discord.Client()
  c=0
  
  
  @client.event
  async def on_message(message):
    if message.content.startswith('!stat'):
      await message.channel.send('Calculating...')
  
      if message.author==client.user:
        c=+1
        await message.channel.send(&quot;{0} has {1} out of the first {2} messages in {3}&quot;.format(client.user.name, str(c), message.channel))
  
  client.run(&quot;Token&quot;)
  
  </code></pre>
  <p>The first part of the code works; when calling the function it sends me the word &quot;Calculating...&quot;, but it will not do more than that. Thank you!</p>