Files
SABrainrotDB
Code
4 755
SABrainrotDB/bot.py
import discord, os, json, random
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
bot = commands.Bot(command_prefix='!', intents=discord.Intents.all())
BRAINROTS = {
"macro": {"value": "Legendary", "exists": 100, "desc": "The original SAB brainrot. Root of all macro lore.", "emoji": "🔥"},
"cow": {"value": "Epic", "exists": 250, "desc": "Moo. Cow-related SAB content.", "emoji": "🐄"},
"mushroom": {"value": "Rare", "exists": 500, "desc": "Fungi-based brainrot from the mushroom fields.", "emoji": "🍄"},
"dirt": {"value": "Common", "exists": 999, "desc": "Dirt mining memes. Basic but eternal.", "emoji": "🟫"},
"eye": {"value": "Legendary", "exists": 50, "desc": "The all-seeing SAB eye. Very rare brainrot.", "emoji": "👁️"},
"void": {"value": "Mythic", "exists": 25, "desc": "Beyond the void. Only true SAB veterans know.", "emoji": "🌌"},
"carrot": {"value": "Uncommon", "exists": 750, "desc": "Carrot-related macro humor.", "emoji": "🥕"},
"potato": {"value": "Common", "exists": 888, "desc": "Potato brainrot. Yes it's a thing.", "emoji": "🥔"},
}
@bot.event
async def on_ready():
print(f'✅ SABrainrotDB is online as {bot.user}')
print(f'📋 {len(BRAINROTS)} brainrots loaded')
@bot.command()
async def lookup(ctx, *, term):
term = term.lower().strip()
result = BRAINROTS.get(term)
if not result:
await ctx.send(f"❌ Brainrot '{term}' not found. Try `!brainrots` for a list.")
return
embed = discord.Embed(title=f"{result['emoji']} {term.upper()}", color=discord.Color.gold())
embed.add_field(name="Tier", value=result["value"], inline=True)
embed.add_field(name="Exist Count", value=result["exists"], inline=True)
embed.add_field(name="Info", value=result["desc"], inline=False)
embed.set_footer(text="SABrainrotDB • !help for commands")
await ctx.send(embed=embed)
@bot.command()
async def exist(ctx, *, term):
term = term.lower().strip()
result = BRAINROTS.get(term)
if not result:
await ctx.send(f"❌ Brainrot '{term}' not found.")
return
await ctx.send(f"{result['emoji']} **{term.upper()}** — **{result['exists']}** exist counts (revealed)")
@bot.command()
async def randombrainrot(ctx, tier=None):
if tier:
tier = tier.capitalize()
filtered = {k:v for k,v in BRAINROTS.items() if v["value"] == tier}
if not filtered:
tiers = list(set(b["value"] for b in BRAINROTS.values()))
await ctx.send(f"❌ Tier '{tier}' not found. Tiers: {', '.join(tiers)}")
return
name, data = random.choice(list(filtered.items()))
else:
name, data = random.choice(list(BRAINROTS.items()))
embed = discord.Embed(title=f"{data['emoji']} {name.upper()}", color=discord.Color.gold())
embed.add_field(name="Tier", value=data["value"], inline=True)
embed.add_field(name="Exist Count", value=data["exists"], inline=True)
embed.add_field(name="Info", value=data["desc"], inline=False)
await ctx.send(embed=embed)
@bot.command()
async def brainrots(ctx):
lines = []
for name, data in sorted(BRAINROTS.items()):
lines.append(f"{data['emoji']} **{name}** — {data['value']} ({data['exists']} exists)")
embed = discord.Embed(title="📋 SAB Brainrots", description="\n".join(lines), color=discord.Color.blue())
embed.set_footer(text=f"Total: {len(BRAINROTS)} brainrots")
await ctx.send(embed=embed)
@bot.command()
async def help(ctx):
embed = discord.Embed(title="🧠 SABrainrotDB Commands", color=discord.Color.purple())
embed.add_field(name="!lookup <term>", value="Look up a brainrot's value and exist count", inline=False)
embed.add_field(name="!exist <term>", value="Quick exist count check", inline=False)
embed.add_field(name="!randombrainrot [tier]", value="Get a random brainrot (optional: filter by tier)", inline=False)
embed.add_field(name="!brainrots", value="List all brainrots", inline=False)
embed.add_field(name="!help", value="Show this message", inline=False)
await ctx.send(embed=embed)
bot.run(os.getenv('DISCORD_TOKEN'))