tessl install tessl/pypi-py-cord@2.6.0A modern, async-ready Python API wrapper for Discord with comprehensive bot development features
Agent Success
Agent success rate when using this tile
93%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.11x
Baseline
Agent success rate without this tile
84%
Build a Discord bot that automates the initial setup of a new server with a comprehensive structure of channels, roles, and permissions.
You need to create a bot that can set up a Discord server with a predefined structure. The bot should respond to a slash command that creates multiple channels organized in categories, sets up roles with specific permissions, and applies appropriate permission overwrites to channels.
Create a slash command /setup that performs the following operations:
Create Roles: Create three roles in the server:
Create Channel Categories: Create two category channels:
Create Text Channels: Create the following text channels:
Apply Permissions: Configure channel permissions appropriately:
Response: After completing the setup, the bot should respond to the command with a summary message listing all created roles and channels.
The bot should handle common errors gracefully:
@generates
import discord
from discord.ext import commands
# Bot instance with required intents
bot: discord.Bot
# Slash command handler that sets up the server structure
async def setup(ctx: discord.ApplicationContext) -> None:
"""
Sets up the server with predefined roles, categories, and channels.
Responds with a summary of created elements.
"""
pass/setup command is invoked in a server, it creates three roles: "Moderator", "Member", and "Guest" @test/setup command is invoked, it creates two categories: "General" and "Staff" @test/setup command is invoked, it creates three text channels: "welcome", "chat", and "mod-chat" in their respective categories @testProvides Discord bot functionality and guild management capabilities.
@satisfied-by