title: Python: AttributeError: 'Client' object has no attribute 'command'
body: <p>Good afternoon! I am new to Python , and I am working on a discord bot. I keep suffering from this error: AttributeError: 'Client' object has no attribute 'command'. I tried everything to repair this, but I did not know. Any help would be fine. Please help me!</p>
  <p>Here is the code:</p>
  <pre><code>import discord
  import random
  from discord.ext import commands
  
  
  
  
  class MyClient(discord.Client):
      client = commands.Bot(command_prefix = '?')
  
  
  # Start
  
  async def on_ready(self):
      print('Logged on as', self.user)
  
  # Latency
  client = discord.Client()
  @client.command()
  async def ping(ctx):
      await ctx.send(f'Pong! {round(client.latency * 1000)}ms')
  
  
  # 8ball
  
  @client.command(aliases=['8ball'])
  async def _8ball(ctx, *, question):
      responses = ['Biztosan.',         
                   'Nagyon kétséges.']
      await ctx.send(f'Kérdés: {question}\nVálasz: {random.choice(responses)}')
  
  # Clear
  
  @client.command()
  async def clear(ctx, amount=5):
      await ctx.channel.purge(limit=amount)
      await ctx.send(f'Kész!')
  
  async def on_message(self, message):
          word_list = ['fasz', 'kurva', 'anyad', 'anyád', 'f a s z', 'seggfej', 'buzi', 'f.a.s.z', 'fa sz', 'k U.rv@ any@dat']
  
         
          if message.author == self.user:
              return
  
          messageContent = message.content
          if len(messageContent) &gt; 0:
              for word in word_list:
                  if word in messageContent:
                      await message.delete()
                      await message.channel.send('Ne használd ezt a szót!')
              
          messageattachments = message.attachments
          if len(messageattachments) &gt; 0:
              for attachment in messageattachments:
                  if attachment.filename.endswith(&quot;.dll&quot;):
                      await message.delete()
                      await message.channel.send(&quot;Ne küldj DLL fájlokat!&quot;)
                  elif attachment.filename.endswith('.exe'):
                      await message.delete()
                      await message.channel.send(&quot;Ne csak parancsikont küldj!&quot;)
                  else:
                      break
  
  client = MyClient()
  client.run(token)
  </code></pre>