title: OnMessage routine for a specific discord channel
body: <p>I am triying to develop a game using a discord bot. Im having trouble dealing with the onmessage routine.. I need it only to &quot;listen&quot; one specific channel, not all the server.. by now I did the following:</p>
  <pre><code>@client.event
  async def on_message(message):
      global rojo
      global IDS
  
      canal = IDS['C_Juego']
  
      if message.author == client.user or str(message.channel) != IDS['C_Juego']:
          return
      else:
          if(rojo == 1):
              autor = message.author
              await message.add_reaction(&quot;&quot;)
              await message.channel.send(&quot;Player: &quot; + str(autor) + &quot; removed!&quot;)
              role = get(message.guild.roles, name=&quot;Jugador&quot;)
              await message.author.remove_roles(role)
          elif(str(message.channel) == IDS['C_Juego']):
              await message.add_reaction(&quot;&quot;)
              print(&quot;verde&quot;)
  </code></pre>
  <p>What's going on? when I enable this function .. the rest of my commands stop having effect (in any channel of the server) in addition to the fact that this function is called by each message sent....</p>
  <p><strong>I explain the context</strong>: It is a game in which while listening to a song the players must place different words under a theme, when the music stops, if someone writes they are eliminated.</p>
  <p><strong>Commands definitios</strong>:
  I have plenty command definitios... which works fine until I add this problematic function.. I add as example two of them:</p>
  <pre><code>@client.command()
  @commands.has_role(&quot;Owner&quot;)
  async def clear(ctx):
      await ctx.channel.purge()
  
  @client.command()
  @commands.has_role(&quot;Owner&quot;)
  async def swipe(ctx, role: discord.Role):
      print(role.members)
      for member in role.members:
          await member.remove_roles(role)
      await ctx.send(f&quot;Successfully removed all members from {role.mention}.&quot;)
  </code></pre>