TSecret Posted September 8, 2020 Report Posted September 8, 2020 Hi, I am making a bot that can will manage my accounts. Currently I am having problems with an idea of storing mulltiple account classes (or instances). The best way probably is to create an array, but I am concerned if this approach will let accounts receive events like incoming messages? let accounts = []; function addAccount(username, password){ client = new Steam() client.logOn({username, password}); client.on('loggedOn' => { accounts.push(client) } } What would be the best practice for this situation? Thanks in advance! Quote
Dr. McKay Posted September 9, 2020 Report Posted September 9, 2020 Yes, that will work. You just need to make sure to add your event handlers to each instance. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.