Nonsense Placement Mandatory
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    webhook-discordpublic

    Discord Webhooks

    version npm A simple Javascript file for nicely formatting Discord webhooks

    Usage

    It's simple

    To initialise:

    const Webhook = require("webhook-discord")
     
    const Hook = new Webhook("WEBHOOK URL")

    To send an info message:

    Hook.info("WEBHOOK NAME","Info")

    To send a warning message:

    Hook.warn("WEBHOOK NAME", "Warning message")

    To send an error message:

    Hook.err("WEBHOOK NAME","Error")

    To send a success message:

    Hook.success("WEBHOOK NAME","Yay we did something right")

    To send a message with a custom format:

    Hook.custom("WEBHOOK NAME","MESSAGE CONTENT","MESSAGE TITLE","MESSAGE COLOUR (optional)", "IMAGE URL (optional)")

    If specified, color must be a hexadecimal color, and, if specified, image must be a valid image URL.

    To send a message with a custom format and an image:

    Hook.image("WEBHOOK NAME","MESSAGE CONTENT","MESSAGE TITLE", "IMAGE URL")

    Installation

    Either use npm:

    npm install webhook-discord
    

    Or clone from source:

    git clone https://github.com/JoeBanks13/webhook-discord.git
    

    License

    MIT

    install

    npm i webhook-discord

    Downloadsweekly downloads

    124

    version

    2.3.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar