title: How do I implement a shutdown and restart commands in "on message"?
body: <p>My Discord bot runs with discord.py, using the <code>on_message</code> function. How do I create commands to shut down, and another to restart Bot?</p>
  
  <p>My bot runs on a server hosted on repl.it.</p>
  
  <p>Code:</p>
  
  <pre><code>if message.content.upper().startswith("!SHUTDOWN"):
      if "534116283487223809" in [role.id for role in message.author.roles]:
          await client.send_message(message.channel, "*Shutting Down...*")
          time.sleep(0.5)
          #SCRIPT TO SHUT DOWN HERE
  </code></pre>
  
  <p>Ideally the commands should respond to <code>"!shutdown"</code> and <code>"!restart"</code>, and should only be usable by me.</p>