Updated: Add a reporting “bot” to discord for your NodeJS pool

This is an updated article of Add a reporting “bot” to discord for your NodeJS pool this version will exclude the requirement of an external PHP file, and will report directly to Discord.

We pretty much follow the first post, discounting step 2, and replacing Step 3 with the following.

request({
uri: "<your webhook url here>", // The URL to your Discord Webhook URL
method: "POST", // Ignore this, but necessary
form: { // Setting up our form
content: "```cpp\n<CoinName> block [" + job.height + "] found by " + miner.login.substr(0, 6) + " at " + ( totalShares / blockTemplate.difficulty * 100 ).toFixed(1) + "% effort. Unlock in " + ( config.coinDifficultyTarget * config.blockUnlocker.depth ) + "mins```" // A very long string of a single message to send to discord
}
});

Some parts should be easy to follow, replace your webhook URL in the “uri” section, and in the content section.

Everything else should be fairly self explanatory. job.height is the job height, miner.login.substr(0, 6) this is the login address the block finder uses, the first 7 characters. The rest is just math that can be seen in the original post.

I hope this helps!