1.2.5 • Published 2 years ago

@pfearr/discordwebhook v1.2.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Discord Webhook - Easy way to send webhooks

Here are the setups to setup DiscordWebhooks.

  1. Open up discord and go to your server. Create your own Discord Webhook and copy it.
  2. Setup your nodejs File and install

npm install @pfearr/discordwebhook

  1. On your JS file require the module

const webhook = require('@pfearr/discordwebhook');

  1. Create a new webhook clinet and enter your discord webhook URL

const webhookClient = new webhook.Start("webhookURL")

  1. Now, to send it. Username is what you want your webhook's username to be, Text is the text you want your webhook to send. Avatar URL is the URL of your webhook's avatar. This is optional. Time is the amount of time before your webhook sends. This is optional. TTS is text to speech. This is optional.

webhookClient.Send("username","text","avatar_URL (optional)","Time (optional)","TTS (optional)"); // Sends a normal webhook message.

webhookClient.SendEmbed(EmbedArray[],"username","text","avatar_URL (optional)","Time (optional)"); // Sends a Embed webhook message

Find more on Embeds on their docs. https://discord.com/developers/docs/resources/channel#embed-object.

Make an embed here: https://discohook.org.

You only need "embeds":[] part. Example:

let embed = {  
    "embeds": [
        {
          "title": "Embed 1",
          "color": null
        }
      ]
    }

OPERATION FAILED

If the operation fails, the webhook will be rejected and will not send. This will NOT error and just display a message telling you the error reason. This is to prevent your coding from stopping and erroing

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.0

2 years ago