1.2.2 • Published 5 years ago

@devartsite/whm v1.2.2

Weekly downloads
18
License
Apache-2.0
Repository
github
Last release
5 years ago

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 ...

1.2.2

5 years ago

1.2.0

5 years ago

1.1.9

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.2.1

5 years ago

1.1.10

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago