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);
SetEmbed(Array);
SetImage(String);
SetMentions(Object);
SetMessage(String);
SetToken(String);
SetUsername(String);
Example code
import HDN from "halal-discord-npm";
HDN.SetToken("My Webhook Token");
HDN.SetMessage("My cool webhook");
HDN.SetUsername("Cool webhook guy");
HDN.Request_Post();
Full Example code
import HDN from "halal-discord-npm";
HDN.SetToken("My Webhook Token");
HDN.SetMessage("My cool webhook");
HDN.SetUsername("Cool webhook guy");
HDN.SetEmbed([
{
color: 11730954,
title: 'title',
description: 'WOW COOL',
fields: [
{
name: 'field 1',
value: 'value',
}
]
}
])
HDN.SetImage("/Path/To/Image OR https://MyImage.com/cookie.png")
HDN.SetMentions({
parse: ['users', 'roles']
})
HDN.Request_Post();
Note
Thank you for reading this.
Also to the npm user's don't mind the random keyword's.