title: Discord.py - Server mute user
body: <p>I'm using discord.py but not using command and I have no intention in changing. To explain the goal of the bot I will use a small scheme:</p>
  
  <ol>
  <li>server member sends a message like this: £Start @user#0001</li>
  <li>pinged user gets server muted (no one can hear him in any voice chat)</li>
  <li>10 seconds pass</li>
  <li>user gets unmuted</li>
  <li>1-minute passes</li>
  <li>user gets muted and so on forever...</li>
  </ol>
  
  <p>I know this is a Troll bot. But we need to have fun sometime...</p>
  
  <p>I have already done the biggest part, but I'm having trouble muting the user.</p>
  
  <pre class="lang-py prettyprint-override"><code># IMPORT
  import discord
  import time
  
  # VARIABLES
  token = "sorry but no"
  client = discord.Client()
  
  # CODE
  @client.event
  async def on_message(message):
      start = False
  
      # CODE
      if message.content.startswith("£Start &lt;@!"):
          # Extract id from message
          message_content = message.content
          user_id = message_content.replace("£Start &lt;@!", "")
          user_id = user_id.replace("&gt;", "")
  
          rep_message = message
          await message.delete()
          start = True
          user_obj = await rep_message.guild.fetch_member(user_id)
  
          if str(user_obj.status) != "online" and start is True:  # if user is online and start is True:
              # loop
              while start:
                  # NEED HELP HERE &gt;&gt; server mute = True
                  time.sleep(10)
                  # NEED HELP HERE &gt;&gt; server mute = False
                  time.sleep(30)
          else:
              return
      else:
          return
  
  client.run(token)
  </code></pre>
  
  <p>I hope is clear enough where I need help.</p>