title: How to manage invite link in private channel?
body: <p><strong><em>What I did:</em></strong></p>
  
  <p>I developed a <code>Telegram</code> bot using <a href="https://telegraf.js.org/#/" rel="noreferrer">TelegrafJS</a> framework. This bot allow the user to subscribe to a paid channel, this channel is privated.</p>
  
  <p>So after that the payment is completed, the bot send the invitation link to let the user join to the channel.</p>
  
  <p><strong><em>The problem</em></strong></p>
  
  <p>Now suppose that the paying user send the invitation link to another user (who didn't pay), the non-paying user will get the access to the paid channel as if it paid.</p>
  
  <p>Before thinking of a solution, it's necessary to know the limit about the invitation links of Telegram:</p>
  
  <ul>
  <li>It's not possible to add a user to a channel without invite link;</li>
  <li>It's not possible to create a single-use invite link;</li>
  <li>It's not possible to create a personal invite link (that only one user can use);</li>
  <li>Invite links are cached on Telegram servers and become unstable if you reset them too fast (try resetting a link 2-3 times in 10 seconds using your Telegram app — you'll understand what I mean).</li>
  </ul>
  
  <p><strong><em>What I thought as solution</em></strong></p>
  
  <p>I thought to show the invite link behind an inline button, so the user will see <em>CLICK HERE</em> button for 3 seconds then this will be revoked and another link will be created. This doesn't remove the problem of access to the paying channel without pay a subscription, but it makes life for unfair users more difficult.</p>
  
  <p>Possible other problem: When the user click on the link got:</p>
  
  <blockquote>
    <p>Sorry, this channel doesn't seem to exist.</p>
  </blockquote>
  
  <p>This means that the invite link to the channel is unstable at the moment. It usually happens after clicking <em>Join</em> several times in row OR if multiple users are trying to join at the same time.</p>
  
  <blockquote>
    <p>Too many attempts, please try again later</p>
  </blockquote>
  
  <p>It means that the user has clicked on too many invalid invite links recently. Most likely, he had a lot of messages "Sorry, this channel doesn't seem to exist" right before this one or joined too many channels/groups in a row.</p>
  
  <p><strong><em>Conclusion</em></strong></p>
  
  <p>Is there a more secure way to handle this?</p>