title: Python on_reaction_add
body: <p>So I just starded codeing in Python and I am currently working on a Ticketbot. If you react the bot should create a Channel and Count the Channel name 1 Number up. I Made a Code but it just doesn't work and can't find any help online so my Friend told me to ask here.</p>
  <p>This is my Code (The Embeds are on German so just ignore them):</p>
  <pre><code>@bot.event
  
  async def on_reaction_add(ctx, user):
      
  with open(&quot;data.json&quot;) as f:
          data = json.load(f)
  
      user = ctx.author
      ticket_number = int(data[&quot;ticket-counter&quot;])
      ticket_number += 1
  
      ticket_channel = await ctx.guild.create_text_channel(&quot;ticket-{}&quot;.format(ticket_number))
      await ticket_channel.set_permissions(ctx.guild.get_role(ctx.guild.id), send_messages=False,
                                           read_messages=False)
      for role_id in data[&quot;valid-roles&quot;]:
          role = ctx.guild.get_role(role_id)
  
          await ticket_channel.set_permissions(role, send_messages=True, read_messages=True, add_reactions=True,
                                                   embed_links=True, attach_files=True, read_message_history=True,
                                                   external_emojis=True)
  
      await ticket_channel.set_permissions(user, send_messages=True, read_messages=True, add_reactions=True,
                                               embed_links=True, attach_files=True, read_message_history=True,
                                               external_emojis=True)
  
      await ticket_channel.set_permissions(user, send_messages=True, read_messages=True, add_reactions=True, embed_links=True, attach_files=True, read_message_history=True,external_emojis=True)
      em = discord.Embed(title=&quot;Ticket Erstellt von {}#{}&quot;.format(ctx.user.name, ctx.user.discriminator),
                             description=&quot;{}&quot;.format(message_content), color=0xf1c40f)
      em2 = discord.Embed(title=&quot;Guten Tag {}&quot;.format(ctx.user.name),
                              description=&quot;Willkommen im Ticket Support. Wir bitten dich dein Problem so ausführlich wie möglich uns mitzuteilen. Wir bitten dich ein wenig Geduld zu haben. \nWir werden dein Ticket so schnellst wie möglich bearbeiten.&quot;,
                              color=0xad1457)
  
      await ticket_channel.send(embed=em)
      await ticket_channel.send(embed=em2)
  
      pinged_msg_content = &quot;&quot;
      non_mentionable_roles = []
  
      if data[&quot;pinged-roles&quot;] != []:
  
          for role_id in data[&quot;pinged-roles&quot;]:
              role = ctx.guild.get_role(role_id)
  
              pinged_msg_content += role.mention
              pinged_msg_content += &quot; &quot;
  
              if role.mentionable:
                  pass
              else:
                  await role.edit(mentionable=True)
                  non_mentionable_roles.append(role)
  
          await ticket_channel.send(pinged_msg_content)
  
          for role in non_mentionable_roles:
              await role.edit(mentionable=False)
  
      data[&quot;ticket-channel-ids&quot;].append(ticket_channel.id)
  
      data[&quot;ticket-counter&quot;] = int(ticket_number)
      with open(&quot;data.json&quot;, 'w') as f:
          json.dump(data, f)
  
      created_em = discord.Embed(title=&quot;Ticket Support:&quot;,
                                     description=&quot;Dein Ticket wurde erfolgreich erstellt! **{}**&quot;.format(
                                         ticket_channel), color=0xad1457)
      await ctx.send(embed=created_em)
  </code></pre>
  <p>Thx for reading it and trying to help :)</p>