Webhookmanager is a manager of webhook in cli
Easy to use, it will allow you to send notifications on Discord or your phone with Macrodroid
- Add a webhook (Discord, Macrodroid)
- Delete a webhook
- View infos of webhook by name
- View list of webhooks
- Execute webook with message
To install whm :
npm install -g @devartsite/whm
And run this command to see help :
whm -h
- To add a webhook (-d for discord or -m for macrodroid):
whm add <name> <url> <option>
- To delete a webhook:
whm del <name>
- To get info of webhook by name:
whm info <name>
- To list your webhooks:
whm list
- To execute a webhook:
Options (-d --date to attach a new date to the message, -w --who to find out who did what):
whm exec <name> <message>
- date option:
whm exec mywebhook "my message at {{date}} with date on middle" -d
whm exec mywebhook "my message with date on end of message, at " -d
- who option:
whm exec mywebhook "my message by {{who}} with who on middle" -w
whm exec mywebhook "my message with who on end of message, at " -w
- date option:
If you need to receive a notification on a webook when someone connects to your server in ssh, you can use the example below.
-
Example 1 (Discord webook)
First you do add your webhook
whm add mywebhook https://discordapp.com/api/webhooks/<channelid>/<webhookid> -d
Now in the user file ".bashrc" add this line:
whm exec mywebhook "Connection shell to example by {{who}} at {{date}}" -w -d
Now when someone connects to shell example you receive this notification on your server Discord
-
Example 2 (Macrodroid webook)
WARNING!! You have to add your macrodroid url in tiny url else if you don't so that, your webhook will not work
First you do add your webhook
whm add mywebhook https://tinyurl.com/<id>/<secret> -m
Now in the user file ".bashrc" add this line:
whm exec mywebhook "Connection shell to example by {{who}} at {{date}}" -w -d
Now when someone connects to shell example you receive this notification on your Device where you have previously configured this webhook in Macrodroid
- API to use this module easily by importing it into a project
- Possibility to send custom data
Maybe more ...