title: Toggling Anti-Ad discord.py
body: <p>my friend has an anti-ad command and he wants to make it toggleable. I tried but I wasn't able to do it. I would be so happy if someone helped me.</p>
  <p>Here's the code:</p>
  <pre class="lang-py prettyprint-override"><code>@bot.event
  async def on_message(message):
     if &quot;discord.gg&quot; in message.content.lower():
         await message.delete()
         await message.channel.send(&quot;Don't advertise your server!&quot;)
         await bot.process_commands(message)
  </code></pre>