title: How to solve this synchro problem discord.py?
body: <p>I have 2 same scripts in Python, that are being used as 2 discord bots. They have different tokens and channel's ids.</p>
  <p>The problem is that one bot is sending same message to another on different server.
  For Instance, if I'm typing to one of my bots &quot;!test&quot;
  It should respond with e.g. &quot;Hello&quot;, but it's responding as different bot on other server.
  I have no idea what's going on.</p>
  <pre><code>import discord
  from discord.ext.commands import Bot
  import csv
   
  #Logging stuff
  #def setup_log():
  #    import logging
          
  #    logging.basicConfig(level=logging.INFO)
  #    logger = logging.getLogger('discord')
  #    logger.setLevel(logging.DEBUG)
  #    handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
  #    handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
  #    logger.addHandler(handler)
  #setup_log()
  
  #Role that can give the points to others
  PRIV_ROLE = 'OperatorStarć'
  
  #PREFIX
  PREFIX = '!'
  
  #CHANNEL
  CH = 846290523659567114
  
  #TOKEN
  TOKEN = 'ODAxNDc4OTMwMTIwMTc5NzMy.YAhRaw.BoUfquqW9c4l29C63VwJSf6rdVo'
  
  #Main Prefix and instance of 'my_bot'
  intents = discord.Intents.default()
  intents.members = True
  my_bot = Bot(command_prefix=PREFIX, intents=intents)
  
  @my_bot.event
  async def on_ready():
      from os import system, name
      if name == &quot;nt&quot;:
          system(&quot;cls&quot;)
      else:
          system(&quot;clear&quot;)
      print(&quot;[Discord Bot has been started]&quot;)
  
  @my_bot.event
  async def on_message(message):
      #Channel on which the bot operate
      channel = my_bot.get_channel(CH)
      
      #Prefixes
      
      #TEST
      if message.content.startswith('{0}test'.format(PREFIX)):
          await channel.send('Heil Reiner!')
      
      #LISTA
      if message.content.startswith('{0}list'.format(PREFIX)):
  
          embed = discord.Embed(
              title=&quot;Lista Żołnierzy:&quot;,
              description=&quot;Imiona żołnierzy i ich liczba starć.&quot;,
              colour = discord.Colour.blue()
          )
  
          embed.set_image(url='https://cdn.discordapp.com/attachments/299534607232139265/846365370080034816/unknown.png')
  
          with open('data.csv', newline='', encoding='utf-8') as csvfile:
              spamreader = csv.reader(csvfile, delimiter=';', quotechar='|')
              content = &quot;&quot;
              for row in spamreader:
                  if len(row)&gt;0:
                      embed.add_field(name=row[0], value=row[1], inline=False)
  
          await channel.send(embed=embed)
      
      #DODAWANIE PUNKTÓW
      if message.content.startswith('{0}add_points'.format(PREFIX)):
          role = discord.utils.find(lambda r: r.name == PRIV_ROLE, message.guild.roles)
          if role in message.author.roles:
              content = str(message.content)[11:]
              tmp = content[content.index(&quot;+&quot;)+1:]
              tmp = tmp.replace(&quot; &quot;, &quot;&quot;)
              
              if int(tmp) &lt; 1000:
                  content = content[:content.index(&quot;+&quot;)]+&quot;+&quot;+tmp
  
                  #Check For Syntax
                  if content.find(&quot;+&quot;) == -1:
                      await channel.send(&quot;Poprawna składnia powinna składać się z nazwy użytkownika, '+' i liczby dodawanych starć!&quot;)
                  else:
                      members = []
                      r = csv.reader(open('data.csv', &quot;r&quot;, encoding=&quot;utf-8&quot;), delimiter=';') # Here your csv file
  
                      for row in r:
                          if len(row) &gt; 0:
                              members.append(row)
  
                      found = 0
                      w = csv.writer(open('data.csv', &quot;w&quot;, encoding=&quot;utf-8&quot;), delimiter=';') # Here your csv file
                      for member in members:
                          if member[0] == content[:content.index(&quot;+&quot;)]:
                              try:
                                  int(content[content.index(&quot;+&quot;)+1:])
                              except:
                                  await channel.send(&quot;Niepoprawna składnia!&quot;)
                              member[1] = str(int(member[1])+int(content[content.index(&quot;+&quot;)+1:]))
                              await channel.send(&quot;Dodano {0} Starć!&quot;.format(tmp))
                              found = 1
                              w.writerows(members)
  
                      if found == 0:
                          w = csv.writer(open('data.csv', &quot;a&quot;, encoding=&quot;utf-8&quot;), delimiter=';') # Here your csv file
                          w.writerows(members)
                          w.writerow([content[:content.index(&quot;+&quot;)], content[content.index(&quot;+&quot;)+1:]])
                      
                      found = 0
          else:
              await channel.send(&quot;Nie masz odpowiednich uprawnień!&quot;)
          
      if message.content.startswith('{0}mypoints'.format(PREFIX)):
          author = message.author.nick
          if author == None:
              author = message.author.name
          author = author.strip()
          
          embed = discord.Embed(
              title=author,
              description=&quot;Twoje imię i liczba starć.&quot;,
              colour = discord.Colour.green()
          )
  
          embed.set_image(url=message.author.avatar_url)
  
          with open('data.csv', newline='', encoding='utf-8') as csvfile:
              spamreader = csv.reader(csvfile, delimiter=';', quotechar='|')
              content = &quot;&quot;
              for row in spamreader:
                  if len(row)&gt;0:
                      tmp = row[0]
                      tmp = tmp.strip()
                      if tmp == author:
                          embed.add_field(name=&quot;Starcia&quot;, value=row[1],inline=True)
          await channel.send(embed=embed)
      
      if message.content.startswith('{0}rem_points'.format(PREFIX)):
          role = discord.utils.find(lambda r: r.name == PRIV_ROLE, message.guild.roles)
          if role in message.author.roles:
              content = str(message.content)[11:]
              tmp = content[content.index(&quot;-&quot;)+1:]
              tmp = tmp.replace(&quot; &quot;, &quot;&quot;)
              content = content[:content.index(&quot;-&quot;)]+&quot;-&quot;+tmp
  
              #Check For Syntax
              if content.find(&quot;-&quot;) == -1:
                  await channel.send(&quot;Poprawna składnia powinna składać się z nazwy użytkownika, '-' i liczby odejmowanych starć!&quot;)
              else:
                  members = []
                  r = csv.reader(open('data.csv', &quot;r&quot;, encoding=&quot;utf-8&quot;), delimiter=';') # Here your csv file
  
                  for row in r:
                      if len(row) &gt; 0:
                          members.append(row)
  
                  found = 0
                  w = csv.writer(open('data.csv', &quot;w&quot;, encoding=&quot;utf-8&quot;), delimiter=';') # Here your csv file
                  for member in members:
                      if member[0] == content[:content.index(&quot;-&quot;)]:
                          try:
                              int(content[content.index(&quot;-&quot;)+1:])
                          except:
                              await channel.send(&quot;Niepoprawna składnia!&quot;)
                          if int(member[1]) &lt; int(content[content.index(&quot;-&quot;)+1:]):
                              await channel.send(&quot;Niepoprawna liczba Starć!&quot;)
                              break
                          member[1] = str(int(member[1])-int(content[content.index(&quot;-&quot;)+1:]))
                          await channel.send(&quot;Usunięto {0} Starć!&quot;.format(tmp))
                          found = 1
                          w.writerows(members)
              
                  if found == 0:
                      w.writerows(members)
                  
                  found = 0
          else:
              await channel.send(&quot;Nie masz uprawnień!&quot;)
      if message.content.startswith('{0}help'.format(PREFIX)):
          embed = discord.Embed(
              title=&quot;POMOC&quot;,
              description=&quot;Komendy i ich działanie&quot;,
              colour = discord.Colour.orange()
          )
          embed.add_field(name=&quot;!list&quot;, value=&quot;Wyświetla starcia wszystkich użytkowników.&quot;, inline=False)
          embed.add_field(name=&quot;!add_ponts&quot;, value=&quot;Dodaje określoną liczbę  starć (składnia: !add_points nazwa.użytkowinika+liczba).&quot;, inline=False)
          embed.add_field(name=&quot;!rem_ponts&quot;, value=&quot;Usuwa określoną liczbę  starć (składnia: !rem_points nazwa.użytkowinika-liczba).&quot;, inline=False)
          embed.add_field(name=&quot;!mypoints&quot;, value=&quot;Wyświetla starcia użytkownika wpisującego komendę.&quot;, inline=False)
          embed.add_field(name=&quot;!test&quot;, value=&quot;Heil Reiner.&quot;, inline=False)
          embed.add_field(name=&quot;!help&quot;, value=&quot;Jak myślisz?&quot;, inline=False)
  
          await channel.send(embed=embed)
  
  #clean the log
  #def clean_log():
  #    with open(&quot;discord.log&quot;, &quot;w&quot;) as f:
  #        f.write(&quot;&quot;)
  #clean_log()
  
  #RUNNING
  my_bot.run(TOKEN)
  </code></pre>