A simple Node.js application to send messages to a Discord webhook with customizable username, avatar, and message repetition.
Made with ❤ by Aarav Mehta
Visit my website
Webhook.gg is a command-line tool built with Node.js that allows users to send messages to a Discord webhook. It prompts the user for the webhook URL, username, avatar URL, message content, and the number of times to send the message. The tool uses the discord.js library to interact with Discord's webhook API and readline for command-line input handling.
- Send messages to a Discord webhook.
- Customize the webhook's username and avatar.
- Specify how many times the message should be sent.
- Simple and interactive command-line interface.
Before running the application, ensure you have the following installed:
- Node.js (v12.0.0 or higher recommended)
- A Discord webhook URL (you can create one in a Discord server under channel settings > Integrations > Webhooks)
-
Clone or Download the Project
Clone this repository or download the code to your local machine.git clone <repository-url> cd webhook-gg
-
Install Dependencies
Run the following command to install the required Node.js packages:npm install discord.js readline
-
Verify Setup
Ensure thediscord.jsandreadlinemodules are listed in yourpackage.jsonor installed in thenode_modulesfolder.
-
Run the Application
Start the script using Node.js:node index.js
-
Follow the Prompts
The application will ask for the following inputs:- Webhook URL: Paste the full Discord webhook URL (e.g.,
https://discord.com/api/webhooks/123456789/abcdefg). - Webhook Username: Enter the name you want the webhook to display.
- Webhook Avatar URL: Provide a direct image URL (e.g.,
https://example.com/avatar.png) or leave blank for the default avatar. - Message: Type the message you want to send.
- Number of Times: Enter how many times to send the message (must be a valid number).
- Webhook URL: Paste the full Discord webhook URL (e.g.,
-
Example Interaction
[NodeJS Runtime Enviroment] Welcome to NodeJS Engine. Starting application. [webhook.gg] The Webhook URL you want to send messages to : https://discord.com/api/webhooks/123456789/abcdefg [webhook.gg] What should be the name of the webhook user : MyBot [webhook.gg] What should be the Avatar of the Webhook user : https://example.com/avatar.png [webhook.gg] What is the message to send through the Webhook User : Hello, world! [webhook.gg] How many times the message is to be send : 3Output:
[webhook.gg] Sent Hello, world! to your webhook! [webhook.gg] Sent Hello, world! to your webhook! [webhook.gg] Sent Hello, world! to your webhook! [NodeJS Runtime Enviroment] Process Completed! Closing NodeJS Engine Now! -
Error Handling
- If the number of times is not a valid number, the program will exit with an error message:
[webhook.gg] ERROR : That is not a Valid Number. Exiting [Node.js Runtime Enviroment] Application Exited! Closing the engine.
- If the number of times is not a valid number, the program will exit with an error message:
-
Dependencies:
discord.js: Used to interact with Discord's webhook API.readline: Provides an interface for reading input from the command line.
-
Workflow:
- The script initializes a
readlineinterface to capture user input. - It prompts for the webhook URL, username, avatar, message, and repetition count.
- The webhook URL is split to extract the
idandtokenrequired bydiscord.js. - A
WebhookClientis created and sends the message the specified number of times. - The program exits gracefully after completion or on error.
- The script initializes a
Feel free to fork this project and submit pull requests with improvements! Suggestions for better error handling, additional features, or UI enhancements are welcome.
This project is open-source and available under the LICENSE.
Created by Aarav Mehta.
For questions or support, reach out to me at the Discord Server
Last Updated: March 12, 2025