StreamLabs Top Donation handler (creates topDonation.txt)


So, another user had this request and I actually already wrote this for my friends bot.

What it does, is whenever you receive a donation from StreamLabs, this file will wait 5 seconds (In a hope that the built in donationHandler will have finished processing the donation), then it will go through the entire donation table, add all the donations to each user to get their totals, and finally, find the one that has donated the most and write their name to ./addons/donationHandler/topDonation.txt

This should be a very simple setup.

Pre-guide warnings: Make a backup of your bot, I am not responsible for your loss of data in the event this system does not get added to your bot properly. At the very least, back up your botlogin.txt and phantombot.db. It’s advised to turn off your bot while adding new scripts, and then turn it back on when you’re done.

Step 1: Ensure you have the following directory, if you do not, create it.

Step 2: Download the following file, and place it in the directory mentioned above. Make sure to save it as topStreamLabsDonator.js otherwise there might be unexpected issues.

topStreamLabsHandler.js (2.7 KB)

Step 3: Restart your bot.

Step 4: Enjoy.

Any errors? Suggestions? Feedback? post it in this thread so I can get back to you.

NOTE You must have both this module AND your donationHandler module enabled for this system to work.

Top Donor/s and Top Donation/s
More .txt/.html outputs