0% found this document useful (0 votes)
7 views

message (2)

This document outlines a Discord bot implemented using the Nextcord library, featuring various commands such as sending messages, impersonating users, and initiating a fake dox protocol. It includes functionality for a starboard system to highlight popular messages and allows specific users to send customizable embed messages. Additionally, it provides commands for insults, compliments, and memes, along with a help command to list available functionalities.

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)
7 views

message (2)

This document outlines a Discord bot implemented using the Nextcord library, featuring various commands such as sending messages, impersonating users, and initiating a fake dox protocol. It includes functionality for a starboard system to highlight popular messages and allows specific users to send customizable embed messages. Additionally, it provides commands for insults, compliments, and memes, along with a help command to list available functionalities.

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/ 6

import asyncio

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 = [1271978091274567690,763268543491866644]
MEME_CHANNEL_ID = 1280830092398039050

# DO NOT TOUCH ANYTHING BELOW THIS POINT

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", description="Send a message as the bot.")


async def send_message(interaction: Interaction, message: str):

if interaction.user.id not in ALLOWED_IDS:


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("Message sent!", ephemeral=True)


await interaction.channel.send(formatted_message)

@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:
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:
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

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)

async def countdown_message(message, new_content):


await message.edit(content=new_content)
await asyncio.sleep(0.5)

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

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

@bot.slash_command(name="insult", description="Insult a user.")


async def insult(interaction: nextcord.Interaction, user: nextcord.Member):
random_insult = get_random_insult()
await interaction.response.send_message(f'{user.mention}, {random_insult}')

@bot.slash_command(name="compliment", description="Give a compliment to a user.")


async def compliment(interaction: nextcord.Interaction, user: nextcord.Member):
random_compliment = get_random_compliment()
await interaction.response.send_message(f'{user.mention}, {random_compliment}')

@bot.slash_command(name="nuke", description="Initiate a nuke sequence.")


async def nuke(interaction: nextcord.Interaction, target_name: str):
nuke_message = await interaction.response.send_message(f"Initiating nuke
sequence for {target_name}...")

async def countdown_message(message, text, count):


for i in range(count, 0, -1):
await message.edit(content=f"{text}... ({i})")
await asyncio.sleep(1)
await message.edit(content=text)

await countdown_message(nuke_message, "Obtaining launch codes", 3)


await countdown_message(nuke_message, "Sending encrypted codes to the missile
silo", 2)
await countdown_message(nuke_message, "Codes received and authenticated", 2)
await countdown_message(nuke_message, "Missile launch in progress", 2)
await countdown_message(nuke_message, "Nuclear missile has taken off", 1)
await countdown_message(nuke_message, "Missile is en route to the target", 1)
await countdown_message(nuke_message, "Nuclear missile is approaching the
target", 1)
await countdown_message(nuke_message, "Awaiting final authorization", 0)
await countdown_message(nuke_message, "Calculating impact trajectory", 0)
await countdown_message(nuke_message, "Target coordinates confirmed", 0)
await countdown_message(nuke_message, "Preparing for maximum destruction", 0)
await countdown_message(nuke_message, "Target lock acquired", 0)

gif_url = "https://j.gifs.com/mlZwNN.gif"
async with interaction.channel.typing():
final_message_content = f"Looks like {target_name} just got nuked"
await nuke_message.delete()
await interaction.channel.send(content=final_message_content)
await interaction.channel.send(gif_url)

@bot.slash_command(name="meme", description="Send a random meme from the meme


channel.")
async def meme(interaction: nextcord.Interaction):
meme_channel = bot.get_channel(MEME_CHANNEL_ID)
if meme_channel is None:
await interaction.response.send_message("Meme channel not found.",
ephemeral=True)
return

messages = await meme_channel.history(limit=100).flatten()


attachments = [msg for msg in messages if msg.attachments]
if not attachments:
await interaction.response.send_message("No memes found in the meme
channel.", ephemeral=True)
return

random_attachment = random.choice(attachments)
attachment = random.choice(random_attachment.attachments)
await interaction.response.send_message(content=f"{attachment.url}")

commands_list = {
"send": "Send a message as the bot. Type back slash followed by n to skip to
the next line.",
"send_embed": "Send a customizable embed message as the bot.",
"impersonate": "Impersonate a member.",
"dox": "Initiate a fake dox protocol.",
"insult": "Insult a user.",
"compliment": "Give a compliment to a user.",
"nuke": "Initiate a nuke sequence.",
"meme": "Send a random meme from the meme channel.",
"help": "Shows this list."
}

@bot.slash_command(name="help", description="List all available commands.")


async def help_command(interaction: nextcord.Interaction):
embed = nextcord.Embed(title="Available Commands", color=nextcord.Color.blue())

for command, description in commands_list.items():


embed.add_field(name=f"/{command}", value=description, inline=False)

await interaction.response.send_message(embed=embed)

bot.run('MTI4MDUwMzgyMjA3NDExODE5NA.G9wd5W.gSazL8MbwRsM4Zvy-DbVK85-cDWiy1kJ1l2Uj4')

You might also like