Discordify is a wrapper to execute UNIX shell commands and notify a channel in either Slack or Discord about the results.
pip install git+https://github.com/OwnHeroNet/discordify
alias discordify="python3 -m discordify"
# wrap my_tool executable in discordiy
discordify my_tool
# wrap my_tool executable in discordiy
discordify my_tool | tee -f log
# this also supports pipes
cat /tmp/socket | discordify process_input >/var/log/something
The configuration stack is evaluated as follows:
/etc/discordify.conf
${HOME}/.discordify.conf
All configuration options are optional, except for webhook.
The configuration file format is JSON
and comes with the following parameters.
If the user_email
is set, but user_icon
isn't, we infer a gravatar link
automatically. The default thumbnail icon is the Discordify logo.
The footer usually contains "via $HOSTNAME
".
Default color is solarized red.
{
"user_name": "Your Name",
"user_email": "Your Email Address",
"user_url": "Your Website Address",
"thumbnail": "https://path.to.your/image.png",
"color": "0xD11C24",
"title": "Discordify Notification",
"webhook": "https://discordapp.com/api/webhooks/id/token"
}
For a full list of supported options see discordify --help
.
Below you see the user interface for adding webhooks in Discord. Either go to [Server Settings] -> [Webhooks] -> [Create Webhook] and configure a new webhook or go to [Edit Channel] -> [Webhooks] -> [Create Webhook].
Copy the webhook URL and paste it in your Discordify configuration file or use it on the commandline
as discordify --webhook 'https://your-webhook.example'
.