or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/py-cord@2.6.x
tile.json

tessl/pypi-py-cord

tessl install tessl/pypi-py-cord@2.6.0

A 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%

task.mdevals/scenario-7/

Todo Task Manager Bot

A Discord bot that manages todo lists for users using text commands with prefix-based interaction.

Capabilities

Add Todo Items

  • When a user types !todo add Buy groceries, the bot should respond with "Todo added: Buy groceries" @test
  • When a user types !todo add without providing a task description, the bot should respond with "Error: Please provide a task description" @test

List Todo Items

  • When a user types !todo list, the bot should respond with a formatted list of all their todo items, numbered starting from 1 @test
  • When a user with no todos types !todo list, the bot should respond with "You have no todos" @test

Remove Todo Items

  • When a user types !todo remove 1, the bot should remove the first todo and respond with "Removed todo: [task description]" @test
  • When a user types !todo remove 99 for a todo that doesn't exist, the bot should respond with "Error: Todo not found" @test

Command Aliases

  • The !task alias should work identically to !todo for all subcommands @test

Implementation

@generates

API

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

Dependencies { .dependencies }

py-cord { .dependency }

Provides Discord bot functionality with support for text commands, command groups, and cogs.