@devartsite/whm

1.2.2 • Public • Published

WHM (WebHookManager) ========================

npm npm

npm version GitHub package.json version Standard - JavaScript Style Guide GitHub top language GitHub code size in bytes GitHub repo size Libraries.io dependency status for latest release, scoped npm package npm GitHub commit activity npm collaborators NPM

discord GitHub issues Twitter Follow GitHub followers GitHub stars GitHub watchers GitHub forks

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

Features

  • Add a webhook (Discord, Macrodroid)
  • Delete a webhook
  • View infos of webhook by name
  • View list of webhooks
  • Execute webook with message

Installation

To install whm :

npm install -g @devartsite/whm

And run this command to see help :

whm -h

Usage

  • 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:
    whm exec <name> <message>
    Options (-d --date to attach a new date to the message, -w --who to find out who did what):
    • 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

Pratical usage

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

Todo list

  • API to use this module easily by importing it into a project
  • Possibility to send custom data

Maybe more ...

Readme

Keywords

Package Sidebar

Install

npm i @devartsite/whm

Weekly Downloads

14

Version

1.2.2

License

Apache-2.0

Unpacked Size

22.8 kB

Total Files

7

Last publish

Collaborators

  • mnlaugh