npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

halal-discord-npm

v1.1.1

Published

Halal-Discord-NPM is a revamped version of Discord-Module-NPM and is built using Typescript. Quickly and easily use discord webhooks with Halal-Discord-NPM.

Downloads

55

Readme

Halal-Discord-NPM

Halal-Discord-NPM is a revamped version of Discord-Module-NPM and is built using Typescript. Quickly and easily use discord webhooks with Halal-Discord-NPM.

Halal-Discord-NPM is soo easy even a child could use it!

Installation

The module has support for the following:

Any version of typescript.

Requirements:

Must have node version 18 or higher.

Must have a package manager installed.

Must be able to grab modules from npm.

In order to install halal-discord-npm you will need to execute the following command's down below:

ONLY DO THIS IF YOU DO NOT HAVE A PACKAGE.JSON FILE WITHIN YOUR PROJECT!

npm init -y

INSTALLATION COMMAND

npm i halal-discord-npm

Installation from source - ! NOT RECOMMENDED !

In order to install halal-discord-npm from source you will need to execute the following command's down below:

git clone https://github.com/TheMuslimPerson/Halal_Discord_NPM.git
cd Halal_Discord_NPM

Replace npm with your package manager if you want.

npm install
npm run build

Then a directory called "dist" will be created. That's your module

Import methods

Here are some example of importing the module

import DHN from "halal-discord-npm";
import * as DHN from "halal-discord-npm";
import { The_Function_Want, Another_Function_I_Want } from "halal-discord-npm";

Functions

Request_Post(null); // TAKES NOTHING AND RETURNS VOID
SetEmbed(Array); // TAKES IN A ARRAY AND RETURNS VOID
SetImage(String); // TAKES IN A STRING AND RETURNS VOID
SetMentions(Object); // TAKES IN A OBJECT AND RETURNS VOID
SetMessage(String); // TAKES IN A STRING AND RETURNS VOID
SetToken(String); // TAKES IN A STRING AND RETURNS VOID
SetUsername(String); // TAKES IN A STRING AND RETURNS VOID

Example code

// IMPORTING THE MODULE
import HDN from "halal-discord-npm";

// RETURNS VOID
// PARAMEMTERS REQUIRED - STRING PARAMETER
// PARAMETER MUST BE THE WEBHOOK TOKEN
// SET'S THE WEBHOOK TOKEN
HDN.SetToken("My Webhook Token");

// RETURNS VOID
// PARAMETERS REQUIRED - STRING PARAMETER
// SET'S THE MESSAGE CONTENT
HDN.SetMessage("My cool webhook");

// RETURNS VOID
// PARAMEMTERS REQUIRED - STRING PARAMETER
// SET'S THE USERNAME OF THE WEBHOOK
// DEFAULT'S TO THE USERNAME SET WITHIN DISCORD!
HDN.SetUsername("Cool webhook guy");


// RETURNS VOID
// NO PARAMEMTERS REQUIRED
// STARTS THE REQUEST
HDN.Request_Post();

// END OF SCRIPT

Full Example code

// IMPORTING THE MODULE
import HDN from "halal-discord-npm";

// ------------------------------------------ //

// RETURNS VOID
// PARAMEMTERS REQUIRED - STRING PARAMETER
// PARAMETER MUST BE THE WEBHOOK TOKEN
// SET'S THE WEBHOOK TOKEN
HDN.SetToken("My Webhook Token");

// ------------------------------------------ //

// RETURNS VOID
// PARAMETERS REQUIRED - STRING PARAMETER
// SET'S THE MESSAGE CONTENT
HDN.SetMessage("My cool webhook");

// ------------------------------------------ //

// RETURNS VOID
// PARAMEMTERS REQUIRED - STRING PARAMETER
// SET'S THE USERNAME OF THE WEBHOOK
// DEFAULT'S TO THE USERNAME SET WITHIN DISCORD!
HDN.SetUsername("Cool webhook guy");

// ------------------------------------------ //

// RETURNS VOID
// PARAMETERS REQUIRED - ARRAY PARAMETER
// SET'S THE EMBED
HDN.SetEmbed([
    {
        color: 11730954,
        title: 'title',
        description: 'WOW COOL',
        fields: [
            {
              name: 'field 1',
              value: 'value',
            }
        ]
    }
])

// ------------------------------------------ //

// RETURNS VOID
// PARAMETERS REQUIRED - STRING PARAMETER
// SET'S THE WEBHOOK AVATAR IMAGE
// DEFAULT'S TO THE AVATAR IMAGE SET WITHIN DISCORD!
HDN.SetImage("/Path/To/Image OR https://MyImage.com/cookie.png")

// ------------------------------------------ //

// RETURNS VOID
// PARAMETERS REQUIRED - OBJECT PARAMETER
// SET'S THE ALLOWED_MENTIONS
HDN.SetMentions({
    parse: ['users', 'roles']
})

// ------------------------------------------ //

// RETURNS VOID
// NO PARAMEMTERS REQUIRED
// STARTS THE REQUEST
HDN.Request_Post();

// ------------------------------------------ //

// END OF SCRIPT //

Note

Thank you for reading this.

Also to the npm user's don't mind the random keyword's.