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-2/

Multi-Interface Moderation Bot

A Discord bot that implements moderation commands accessible through both slash commands and traditional text prefix commands.

Capabilities

Timeout Command

Implement a timeout command that temporarily restricts a user from sending messages or joining voice channels in a server.

  • When invoked with a valid member and duration (in minutes), the bot times out the specified member for the given duration and responds with a confirmation message @test
  • When invoked with a duration of 0, the bot removes any existing timeout from the member and responds with a confirmation message @test

Warn Command

Implement a warn command that sends a warning message to a user via direct message.

  • When invoked with a valid member and reason, the bot sends a DM to that member with the warning reason @test
  • When the DM cannot be sent (user has DMs disabled), the command responds with an appropriate error message @test

Info Command

Implement an info command that displays information about a server member.

  • When invoked with a valid member, the command responds with an embed showing the member's username, join date, and role count @test
  • When invoked without specifying a member, the command shows information about the user who invoked the command @test

Implementation

@generates

API

import discord
from discord.ext import bridge

# Create a bot instance that supports both slash and prefix commands
bot = bridge.Bot(command_prefix="!", intents=discord.Intents.default())

@bot.bridge_command(name="timeout", description="Timeout a member")
async def timeout(ctx: bridge.BridgeContext, member: discord.Member, minutes: int):
    """
    Times out a member for the specified number of minutes.
    If minutes is 0, removes the timeout.

    Args:
        ctx: The command context (works for both slash and prefix commands)
        member: The member to timeout
        minutes: Duration in minutes (0 to remove timeout)
    """
    pass

@bot.bridge_command(name="warn", description="Warn a member")
async def warn(ctx: bridge.BridgeContext, member: discord.Member, reason: str):
    """
    Sends a warning DM to a member.

    Args:
        ctx: The command context
        member: The member to warn
        reason: The reason for the warning
    """
    pass

@bot.bridge_command(name="info", description="Display member information")
async def info(ctx: bridge.BridgeContext, member: discord.Member = None):
    """
    Displays information about a member in an embed.
    If no member is specified, shows info about the command invoker.

    Args:
        ctx: The command context
        member: The member to get info about (optional, defaults to command invoker)
    """
    pass

Dependencies { .dependencies }

py-cord { .dependency }

Provides Discord API wrapper with bridge command support for creating commands that work as both slash and prefix commands.

@satisfied-by