This is a preview of how your server listing will look with the selected theme colors and background.
About Bot server
import discord
from discord.ext import commands
import random
import asyncio
Setup Intents
intents = discord.Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix='!', intents=intents)
@bot.event
async def on_ready():
print(f'Logged in as {bot.user.name}')
print('------')
@bot.command()
@commands.has_permissions(manage_roles=True)
async def create_roles(ctx, amount: int, *, role_name: str):
"""
Creates multiple roles at once.
Usage: !create_roles 10 Moderator
"""
if amount > 200:
return await ctx.send("Error: Discord limit is 250 roles per server. Try a smaller number.")
await ctx.send(f"Starting to create {amount} roles named '{role_name}'...")
for i in range(1, amount + 1):
try:
# Generate a random color for each role
random_color = discord.Color(random.randint(0x000000, 0xFFFFFF))
# Create the role
await ctx.guild.create_role(
name=f"{role_name} {i}",
color=random_color,
reason="Bulk role creation script"
)
# Avoid Discord Rate Limits (sleep for 0.5s every 5 roles)
if i % 5 == 0:
await asyncio.sleep(0.5)
except discord.Forbidden:
return await ctx.send("Error: I don't have 'Manage Roles' permission.")
except discord.HTTPException as e:
return await ctx.send(f"An error occurred: {e}")
await ctx.send(f"✅ Successfully created {amount} roles!")
Replace with your actual bot token
bot.run('YOUR_BOT_TOKEN_HERE')
What People Talk About
No topics available.
External Link
Platform
You are about to visit:
https://example.comThis will open in a new tab. Make sure you trust this link.