A simple application that executes a time-consuming code block and sends a notification to a given Discord channel (or as direct message) with return value, execution time, and the code block that was executed.
This tool was implemented during a practical session of Pharo Club held after a tech talk by Juraj Kubelka: DiscordSt: API & Pharo Integration.
This application is based on DiscordSt. So you must first install it
Metacello new
baseline: #DiscordSt;
repository: 'github://JurajKubelka/DiscordSt:dev/src';
load.
url := 'https://discordapp.com/api/webhooks/<your webhook id>'.
log := PCDiscordLog withWebhook: url.
"Your time-consuming code"
block := [
| factorials |
factorials := (1 to: 1000) collect: [ :each |
each factorial ].
factorials takeFirst: 10
].
log timeItAndNotify: block.