Xeon
Executive
- Joined
- Oct 22, 2024
- Messages
- 21
- Reaction score
- 13
- Points
- 3
This is a repost of my own github repo available at:
[Log in or register to see link]
BroadcastBot is a Discord bot designed to broadcast messages to specified servers using webhooks. This guide will help you set up and run the bot on a Windows machine.
Name (required): The name of the server or channel.
URL (required): The webhook URL.
Name (required): The name of the server or channel.
Discord limits the number of total simultaneous webhooks to 25 per interaction. To notify more than 25 servers, you will have to run the broadcast command multiple times.
[Log in or register to see link]
BroadcastBot is a Discord bot designed to broadcast messages to specified servers using webhooks. This guide will help you set up and run the bot on a Windows machine.
Prerequisites
- [Log in or register to see link] installed on your machine.
- A Discord bot token and client ID. You can create a bot and get a token/ID from the [Log in or register to see link].
- Permission to create webhooks, or at least the URL for a webhook for each server you intend to include.
Installation
Git Clone:
- Have Node.js installed and Clone the repository:
git clone https://github.com/avexiis/broadcastbot.git
cd broadcastbot
- Install Dependencies:
npm init -y
npm install discord.js fs axios
- Configure the bot: Open the bot.js file and replace the placeholder values with your actual bot token, client ID, and authorized user ID:
JavaScript:
const TOKEN = 'BOT_TOKEN_GOES_HERE';
const CLIENT_ID = 'BOT_CLIENT_ID_GOES_HERE';
const AUTHORIZED_USER_ID = 'YOUR_DISCORD_USER_ID';
- Run the bot by opening Run.bat OR open a command prompt window in your bot directory and type:
node bot.js
Manual:
- Make sure you have node.js installed on your system
- Download the repository as a .zip file
- Open a command prompt and navigate to the bot directory
cd C:\path\to\bot\folder
- Install Dependencies
npm init -y
npm install discord.js fs axios
- Configure the bot: Open the bot.js file and replace the placeholder values with your actual bot token, client ID, and authorized user ID:
JavaScript:
const TOKEN = 'BOT_TOKEN_GOES_HERE';
const CLIENT_ID = 'BOT_CLIENT_ID_GOES_HERE';
const AUTHORIZED_USER_ID = 'YOUR_DISCORD_USER_ID';
- Run the bot by opening Run.bat OR open a command prompt window in your bot directory and type:
node bot.js
Commands
- /broadcast - Broadcast a message to specified servers.
- /addwebhook- Add a webhook to the broadcast list.
Name (required): The name of the server or channel.
URL (required): The webhook URL.
- /removewebhook - Remove a webhook from the broadcast list.
Name (required): The name of the server or channel.
How it works
When the /broadcast command is issued, the bot shows a modal to collect the title and description for the embed message. Once the embed is created, the bot shows a dropdown menu to select the servers to broadcast the message to. Upon confirmation, the bot sends the embed message to the selected servers using the stored webhooks.Discord limits the number of total simultaneous webhooks to 25 per interaction. To notify more than 25 servers, you will have to run the broadcast command multiple times.