'How to run a copy of a Discord bot through a proxy?

I have a Discord bot written in discord.js. I created a referral system so that everyone can create a copy of my Discord bot with their own token, but there was a small problem. I don't know how to run a copy of my Discord bot through a proxy so that there are several identical bots from one VPS, but with different tokens and with different proxies.

I thought about choosing the option to run a copy through child_process or through pm2, but I did not find an option how to use a proxy in these cases. Can you please advise?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source