A modern, async-ready Python API wrapper for Discord with comprehensive bot development features
Overall
score
93%
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.
Install with Tessl CLI
npx tessl i tessl/pypi-py-corddocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10