title: How do I use discord commands
body: <p>I have tried making a bot in discord.py and i cant figure out how to use discord.ext.</p>
  <p>The part that doesn't work is this:</p>
  <pre class="lang-py prettyprint-override"><code>bot = commands.Bot(command_prefix='.')
  
  @bot.command()
  async def test(ctx, arg):
      await ctx.channel.send(arg)
  </code></pre>
  <p>When I type .test whatever in discord nothing happens</p>
  <p>Is it because of the api update?
  If so what do I need to change</p>
  <p>This is the entire code:</p>
  <pre class="lang-py prettyprint-override"><code>import os
  import discord
  import asyncio
  from dotenv import load_dotenv
  from discord.ext import commands
  from discord.ext import bot
  
  
  bot = commands.Bot(command_prefix='$')
  
  @bot.command()
  async def test(ctx, arg):
      await ctx.channel.send(arg)
  
  load_dotenv()
  
  token = os.getenv(&quot;TOKEN&quot;)
  
  client = discord.Client()
  
  
  class MyClient(discord.Client):
      async def on_ready(self):
          print('Logged on as {0}!'.format(self.user))
  
      async def on_message(self, message):
          f = open(&quot;muteMsg.txt&quot;, &quot;r&quot;)
          muteMsg = f.read()
          f.close()
  
          print('Message from {0.author}: {0.content}'.format(message))
  
          id = message.author.id
          if id == 0:
              await message.delete()
              if muteMsg == &quot;1&quot;:
                  await message.channel.send(f&quot;stfu {message.author.mention}&quot;)
  
          elif message.content.startswith('good bot') or message.content.startswith('Good bot'):
              await message.channel.send(':)')
  
          elif message.content.startswith('bad bot') or message.content.startswith('Bad bot'):
              await message.channel.send(':(')
  
          elif message.content.startswith('.rickroll'):
              await message.channel.send('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
  
          elif message.content.startswith('.help'):
              await message.channel.send('commands list:\n.help: shows this\n.rickroll: well youll have to try yourself\n')
  
          elif message.content.startswith('.togglemutemsgs'):
              if muteMsg == &quot;0&quot;:
                  f = open(&quot;muteMsg.txt&quot;, &quot;w&quot;)
                  f.write(&quot;1&quot;)
                  f.close()
                  await message.channel.send('mute messages on')
              elif muteMsg == &quot;1&quot;:
                  f = open(&quot;muteMsg.txt&quot;, &quot;w&quot;)
                  f.write(&quot;0&quot;)
                  f.close()
                  await message.channel.send('mute messages off')
  
  
  client = MyClient()
  client.run(token)
  </code></pre>