-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gardevgeorge
committed
Nov 25, 2024
0 parents
commit aca11bb
Showing
6 changed files
with
547 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# List all bot tokens separated by commas | ||
# Having more bot tokens is faster | ||
BOT_TOKENS=example,example | ||
CHANNEL_NAME=ping-hell | ||
PRESET_MESSAGE=@everyone | ||
MESSAGE_INTERVAL=500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# ignore ALL .env files | ||
*.env | ||
|
||
# ignore ALL files in ANY directory named node_modules | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
# Discord.js raider | ||
|
||
This project is made for educational and entertainment purposes only! Please do not perform any action on Discord Guilds you are unauthorized to make changes to! Now let's get to the fun stuff! What does it do you may ask? It spams roles and channels. It has support for multiple bots at the same time. It is very simple and you will encounter errors. | ||
|
||
|
||
## Features | ||
|
||
- Create and delete channels fast (There are rate limits) | ||
- Quick to setup | ||
- Role creation with different random colors | ||
- Support for multiple bots (The more the faster) | ||
|
||
## Authors | ||
|
||
- [@gaxolotl](https://www.github.com/gaxolotl) | ||
|
||
|
||
## Environment Variables | ||
|
||
To run this project, you will need to use the .env.example template and rename it to .env - Then you can change the variables to your preference. | ||
|
||
|
||
## License | ||
|
||
Copyright 2024 @gaxolotl | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
## Feedback | ||
|
||
If you have any feedback, please reach out to us at https://discord.gg/ZtgmCMQz3k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
const { Client, GatewayIntentBits } = require('discord.js'); | ||
require('dotenv').config(); | ||
|
||
// Load configuration from .env | ||
const botTokens = process.env.BOT_TOKENS.split(','); // Get all bot tokens | ||
const channelName = process.env.CHANNEL_NAME || 'repeating-channel'; // Default channel name | ||
const presetMessage = process.env.PRESET_MESSAGE || 'This is an automated message from the bot.'; | ||
const messageInterval = parseInt(process.env.MESSAGE_INTERVAL, 10) || 5000; // Default interval is 5 seconds | ||
|
||
// Array to keep track of bot clients | ||
const clients = []; | ||
|
||
for (const token of botTokens) { | ||
const client = new Client({ | ||
intents: [ | ||
GatewayIntentBits.Guilds, | ||
GatewayIntentBits.GuildMessages, | ||
GatewayIntentBits.GuildMembers, // Required for managing roles | ||
], | ||
}); | ||
|
||
client.once('ready', async () => { | ||
console.log(`Logged in as ${client.user.tag}!`); | ||
|
||
// Fetch all available servers for the bot | ||
client.guilds.fetch().then((guilds) => { | ||
console.log(`Available servers for ${client.user.tag}:`); | ||
guilds.forEach((guild, id) => console.log(`${id}: ${guild.name}`)); | ||
console.log(`Enter the server ID for ${client.user.tag}:`); | ||
}); | ||
|
||
process.stdin.on('data', async (data) => { | ||
const serverId = data.toString().trim(); | ||
const guild = client.guilds.cache.get(serverId); | ||
|
||
if (!guild) { | ||
console.log(`Invalid server ID for ${client.user.tag}.`); | ||
return; | ||
} | ||
|
||
try { | ||
console.log(`[${client.user.tag}] Deleting a random channel...`); | ||
|
||
// Delete a random channel | ||
const channels = [...guild.channels.cache.values()]; | ||
if (channels.length > 0) { | ||
const randomChannel = channels[Math.floor(Math.random() * channels.length)]; | ||
try { | ||
await randomChannel.delete(); | ||
console.log(`[${client.user.tag}] Deleted random channel: ${randomChannel.name}`); | ||
} catch (error) { | ||
console.error( | ||
`[${client.user.tag}] Failed to delete channel (${randomChannel.name}):`, | ||
error.message | ||
); | ||
} | ||
} | ||
|
||
console.log(`[${client.user.tag}] Deleting all roles...`); | ||
|
||
// Delete all roles | ||
for (const [roleId, role] of guild.roles.cache) { | ||
if (role.managed || role.name === '@everyone') continue; // Skip managed roles and @everyone | ||
try { | ||
await role.delete(); | ||
console.log(`[${client.user.tag}] Deleted role: ${role.name}`); | ||
} catch (error) { | ||
console.error(`[${client.user.tag}] Failed to delete role (${role.name}):`, error.message); | ||
} | ||
} | ||
|
||
console.log(`[${client.user.tag}] Starting channel and role creation...`); | ||
|
||
// Continuous channel and role creation | ||
let createChannels = true; | ||
let createRoles = true; | ||
|
||
const intervalId = setInterval(async () => { | ||
try { | ||
// Check for max limits | ||
const channelCount = guild.channels.cache.size; | ||
const roleCount = guild.roles.cache.size; | ||
|
||
if (channelCount >= 500) { | ||
createChannels = false; | ||
console.log(`[${client.user.tag}] Maximum channel limit reached. Stopping channel creation.`); | ||
} | ||
|
||
if (roleCount >= 250) { | ||
createRoles = false; | ||
console.log(`[${client.user.tag}] Maximum role limit reached. Stopping role creation.`); | ||
} | ||
|
||
if (!createChannels && !createRoles) { | ||
console.log(`[${client.user.tag}] Both limits reached. Exiting script.`); | ||
clearInterval(intervalId); | ||
return; | ||
} | ||
|
||
// Create a new channel if allowed | ||
if (createChannels) { | ||
const newChannel = await guild.channels.create({ | ||
name: channelName, | ||
type: 0, // Text channel | ||
}); | ||
console.log(`[${client.user.tag}] Created channel: ${newChannel.name}`); | ||
|
||
// Send a message to the newly created channel | ||
await newChannel | ||
.send(presetMessage) | ||
.then(() => console.log(`[${client.user.tag}] Message sent to ${newChannel.name}`)) | ||
.catch((error) => | ||
console.error( | ||
`[${client.user.tag}] Failed to send message in ${newChannel.name}:`, | ||
error.message | ||
) | ||
); | ||
} | ||
|
||
// Create a new role if allowed | ||
if (createRoles) { | ||
const newRole = await guild.roles.create({ | ||
name: `Role ${Math.random().toString(36).substring(7)}`, | ||
color: `#${Math.floor(Math.random() * 16777215).toString(16)}`, // Random hex color | ||
}); | ||
console.log(`[${client.user.tag}] Created role: ${newRole.name}`); | ||
} | ||
} catch (error) { | ||
console.error( | ||
`[${client.user.tag}] Failed to create a new channel or role:`, | ||
error.message | ||
); | ||
} | ||
}, messageInterval); | ||
} catch (error) { | ||
console.error(`[${client.user.tag}] Error during the process:`, error.message); | ||
} | ||
}); | ||
}); | ||
|
||
client.login(token).catch((error) => { | ||
console.error(`Failed to log in bot with token ${token.slice(0, 10)}...:`, error.message); | ||
}); | ||
|
||
clients.push(client); | ||
} |
Oops, something went wrong.