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%
A Discord bot that manages todo lists for users using text commands with prefix-based interaction.
!todo add Buy groceries, the bot should respond with "Todo added: Buy groceries" @test!todo add without providing a task description, the bot should respond with "Error: Please provide a task description" @test!todo list, the bot should respond with a formatted list of all their todo items, numbered starting from 1 @test!todo list, the bot should respond with "You have no todos" @test!todo remove 1, the bot should remove the first todo and respond with "Removed todo: [task description]" @test!todo remove 99 for a todo that doesn't exist, the bot should respond with "Error: Todo not found" @test!task alias should work identically to !todo for all subcommands @test@generates
from discord.ext import commands
class TodoCog(commands.Cog):
"""Cog that manages todo lists for users."""
def __init__(self, bot: commands.Bot):
"""Initialize the cog with a bot instance."""
pass
@commands.group(name='todo', aliases=['task'], invoke_without_command=True)
async def todo(self, ctx: commands.Context):
"""Main todo command group."""
pass
@todo.command(name='add')
async def add_todo(self, ctx: commands.Context, *, task: str):
"""Add a new todo item for the user."""
pass
@todo.command(name='list')
async def list_todos(self, ctx: commands.Context):
"""List all todo items for the user."""
pass
@todo.command(name='remove')
async def remove_todo(self, ctx: commands.Context, index: int):
"""Remove a todo item by index."""
pass
async def setup(bot: commands.Bot):
"""Setup function to add the cog to the bot."""
await bot.add_cog(TodoCog(bot))Provides Discord bot functionality with support for text commands, command groups, and cogs.