0% found this document useful (0 votes)
54 views8 pages

Bot

This document outlines a Discord bot built using the Nextcord library, featuring commands for starboard functionality, customizable embeds, impersonation, and a fake dox protocol. It includes permission checks for specific user IDs and roles, as well as various utility functions for generating random data and handling file uploads. The bot is designed to enhance user interaction within a Discord server by providing engaging features and commands.

Uploaded by

SONIC BooM
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)
54 views8 pages

Bot

This document outlines a Discord bot built using the Nextcord library, featuring commands for starboard functionality, customizable embeds, impersonation, and a fake dox protocol. It includes permission checks for specific user IDs and roles, as well as various utility functions for generating random data and handling file uploads. The bot is designed to enhance user interaction within a Discord server by providing engaging features and commands.

Uploaded by

SONIC BooM
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
You are on page 1/ 8

import asyncio

import io
import json
import random
import string

import nextcord
from nextcord import SlashOption, Interaction
from nextcord.ext import commands

intents = nextcord.Intents.default()
bot = commands.Bot(command_prefix="/", intents=intents)

STARBOARD_CHANNEL_ID = 1280296978655215616
STAR_EMOJI = "⭐"
STAR_THRESHOLD = 3
SERVER_ID = 1271929049761185832
ALLOWED_IDS =
[1271345768665710667,763268543491866644,708605521065934900,1226633929289760871,9803
94077591830538,1272007178441588779]
ALLOWED_ROLES =
[1271977409704366183,1276149600230838357,1278065754473762878,1274991622572081173,12
72259101363015701]
BOT_TOKEN =
"MTI4MDk1NzQwMTA5MjE5ODQxMg.GgXagp.9IQLsckRNYaJ_OPV7vsthFDKh62CxjYCuNaN1M"
MEME_CHANNEL_ID = 1280830092398039050
starred_messages = {}

@bot.event
async def on_ready():
print(f'Logged in as {bot.user}')
await
bot.change_presence(activity=nextcord.Activity(type=nextcord.ActivityType.watching,
name="Humans"))

def create_embed(message, star_count):


embed = nextcord.Embed(description=message.content, color=0x773303)
embed.set_author(name=message.author.display_name,
icon_url=message.author.avatar.url)
embed.add_field(name="",
value=f"[Jump to
message](https://discord.com/channels/{message.guild.id}/{message.channel.id}/
{message.id})")
embed.set_footer(text=f"⭐ {star_count}")
return embed

@bot.event
async def on_raw_reaction_add(payload):
if payload.guild_id != SERVER_ID:
return

if payload.emoji.name == STAR_EMOJI:
channel = bot.get_channel(payload.channel_id)
message = await channel.fetch_message(payload.message_id)
starboard_channel = bot.get_channel(STARBOARD_CHANNEL_ID)

if message.id in starred_messages:
embed_message = await
starboard_channel.fetch_message(starred_messages[message.id])
star_count = next((r.count for r in message.reactions if r.emoji ==
STAR_EMOJI), 0)
if star_count >= STAR_THRESHOLD:
embed = embed_message.embeds[0]
embed.set_footer(text=f"⭐ {star_count}")
await embed_message.edit(embed=embed)
else:
await embed_message.delete()
del starred_messages[message.id]
else:
star_count = next((r.count for r in message.reactions if r.emoji ==
STAR_EMOJI), 0)
if star_count >= STAR_THRESHOLD:
embed = create_embed(message, star_count)
embed_message = await starboard_channel.send(embed=embed)
starred_messages[message.id] = embed_message.id

@bot.event
async def on_raw_reaction_remove(payload):
if payload.guild_id != SERVER_ID:
return

if payload.emoji.name == STAR_EMOJI:
channel = bot.get_channel(payload.channel_id)
message = await channel.fetch_message(payload.message_id)
starboard_channel = bot.get_channel(STARBOARD_CHANNEL_ID)

if message.id in starred_messages:
embed_message = await
starboard_channel.fetch_message(starred_messages[message.id])
star_count = next((r.count for r in message.reactions if r.emoji ==
STAR_EMOJI), 0)
if star_count >= STAR_THRESHOLD:
embed = embed_message.embeds[0]
embed.set_footer(text=f"⭐ {star_count}")
await embed_message.edit(embed=embed)
else:
await embed_message.delete()
del starred_messages[message.id]

@bot.slash_command(name="send_embed", description="Send a customizable embed


message as the bot.")
async def send_embed(
interaction: Interaction,
title: str,
description: str,
colour: str = "#773303",
footer: str = ""
):
if interaction.user.id not in ALLOWED_IDS and not any(role.id in ALLOWED_ROLES
for role in interaction.user.roles):

await interaction.response.send_message("You are not allowed to use this


command.", ephemeral=True)
return

if not (colour.startswith("#") and len(colour) == 7 and all(c in


"0123456789abcdefABCDEF" for c in colour[1:])):
colour = "#dfeef5"

try:
embed_color = nextcord.Color(int(colour.lstrip("#"), 16))
except ValueError:
embed_color = nextcord.Color.from_rgb(223, 238, 245)
formatted_description = description.replace("\\n", "\n")

embed = nextcord.Embed(
title=title,
description=formatted_description,
color=embed_color
)
if footer:
embed.set_footer(text=footer)

await interaction.response.send_message("Embed sent!", ephemeral=True)


await interaction.channel.send(embed=embed)

@bot.slash_command(description="Impersonate a member")
async def impersonate(
interaction: Interaction,
person: nextcord.Member = SlashOption(description="Select a member to
impersonate", required=True),
message: str = SlashOption(description="Message to send as the member",
required=True)
):
if interaction.user.id not in ALLOWED_IDS and not any(role.id in ALLOWED_ROLES
for role in interaction.user.roles):

await interaction.response.send_message("You are not allowed to use this


command.", ephemeral=True)
return

display_name = person.global_name if isinstance(person, nextcord.Member) and


person.global_name else person.name
display_name = display_name.split('#')[0]

channel = interaction.channel
await interaction.response.send_message(f"Sending message as
{display_name}...", ephemeral=True)
avatar = await person.avatar.read() if person.avatar else None
webhook = await channel.create_webhook(name=display_name, avatar=avatar)
await webhook.send(content=message)
await webhook.delete()

def load_fake_info():
with open('fake_info.json', 'r') as file:
return json.load(file)
def get_random_fake_info(fake_info):
selected_info = {}
for key, value in fake_info.items():
if isinstance(value, list):
selected_info[key] = random.choice(value)
else:
selected_info[key] = value
return selected_info
async def countdown_message(message, new_content):
await message.edit(content=new_content)
await asyncio.sleep(0.5)
def generate_random_password():
return ''.join(random.choice(string.ascii_letters + string.digits) for _ in
range(6))

@bot.slash_command(name="dox", description="Initiate a fake dox protocol.")


async def dox(interaction: nextcord.Interaction, user: nextcord.User):
await interaction.response.defer()
fake_info = load_fake_info()

dox_message = await interaction.followup.send(f"Initiating dox protocol on


{user.mention}...")

await countdown_message(dox_message, f"Hacking into {user.mention}'s discord


account...")
await asyncio.sleep(0.5)

await countdown_message(dox_message, "Brute forcing the way in")


await asyncio.sleep(0.5)

num_loops = 7

for _ in range(num_loops):
passwords = [generate_random_password() for _ in range(4)]
await dox_message.edit(content=f"passwords failed: {', '.join(passwords)}")

decoded_password = generate_random_password()
await dox_message.edit(content=f"password decoded successfully:
{decoded_password}")
await asyncio.sleep(0.5)
await countdown_message(dox_message, "Commencing data reconnaissance...")
await asyncio.sleep(0.5)
await countdown_message(dox_message, "searching for connections...")
await asyncio.sleep(0.5)
await countdown_message(dox_message, "hacking into connected accounts...")
await asyncio.sleep(0.5)
await countdown_message(dox_message, "Enabling dark web surveillance for
further data...")
await asyncio.sleep(0.5)
await countdown_message(dox_message, "Formulating the definitive data
dossier...")
await asyncio.sleep(0.5)
await countdown_message(dox_message, "All tasks executed flawlessly!")
await asyncio.sleep(0.5)

selected_fake_info = get_random_fake_info(fake_info)
embed = nextcord.Embed(
title=f"Data report on {user.display_name}",
color=nextcord.Color.red()
)
for key, value in selected_fake_info.items():
embed.add_field(name=key, value=value, inline=False)
await interaction.followup.send(embed=embed)
@bot.slash_command(name="send", description="Send a message with up to two files.")
async def send_message(
interaction: Interaction,
message: str,
file1: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file2: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file3: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file4: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file5: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file6: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file7: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file8: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file9: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file10: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file11: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file12: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file13: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file14: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file15: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file16: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file17: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file18: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file19: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),
file20: nextcord.Attachment = SlashOption(description="Attach a file",
required=False),

):
if interaction.user.id not in ALLOWED_IDS and not any(role.id in ALLOWED_ROLES
for role in interaction.user.roles):

await interaction.response.send_message("You are not allowed to use this


command.", ephemeral=True)
return
formatted_message = message.replace("\\n", "\n")

await interaction.response.send_message("Sending...", ephemeral=True)

discord_files = []
if file1:
file_bytes1 = await file1.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes1),
filename=file1.filename))

if file2:
file_bytes2 = await file2.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes2),
filename=file2.filename))

if file3:
file_bytes3 = await file3.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes3),
filename=file3.filename))

if file4:
file_bytes4 = await file4.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes4),
filename=file4.filename))

if file5:
file_bytes5 = await file5.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes5),
filename=file5.filename))

if file6:
file_bytes6 = await file6.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes6),
filename=file6.filename))

if file7:
file_bytes7 = await file7.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes7),
filename=file7.filename))

if file8:
file_bytes8 = await file8.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes8),
filename=file8.filename))

if file9:
file_bytes9 = await file9.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes9),
filename=file9.filename))

if file10:
file_bytes10 = await file10.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes10),
filename=file10.filename))

if file11:
file_bytes11 = await file11.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes11),
filename=file11.filename))
if file12:
file_bytes12 = await file12.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes12),
filename=file12.filename))

if file13:
file_bytes13 = await file13.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes13),
filename=file13.filename))

if file14:
file_bytes14 = await file14.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes14),
filename=file14.filename))

if file15:
file_bytes15 = await file15.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes15),
filename=file15.filename))

if file16:
file_bytes16 = await file16.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes16),
filename=file16.filename))

if file17:
file_bytes17 = await file17.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes17),
filename=file17.filename))

if file18:
file_bytes18 = await file18.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes18),
filename=file18.filename))

if file19:
file_bytes19 = await file19.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes19),
filename=file19.filename))

if file20:
file_bytes20 = await file20.read()
discord_files.append(nextcord.File(io.BytesIO(file_bytes20),
filename=file20.filename))

if discord_files:
await interaction.channel.send(formatted_message, files=discord_files)
else:
await interaction.channel.send(formatted_message)

def get_random_insult():
with open('insults.json', 'r') as file:
insults = json.load(file)
return random.choice(insults)

# Get a random compliment from the JSON file


def get_random_compliment():
with open('compliments.json', 'r') as file:
compliments = json.load(file)
return random.choice(compliments)

# Command to get a random insult


@bot.command(name='insult')
async def insult(ctx):
insult = get_random_insult()
await ctx.send(insult)

# Command to get a random compliment


@bot.command(name='compliment')
async def compliment(ctx):
compliment = get_random_compliment()
await ctx.send(compliment)

bot.run(BOT_TOKEN)

You might also like