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

Server Info Command

Build a Discord bot command that displays comprehensive server information using rich formatted messages.

Requirements

Create a Discord bot with a slash command /serverinfo that displays detailed information about the current server (guild) in a well-formatted, visually appealing message.

The command should display:

  1. Server Overview: Server name and creation date
  2. Statistics: Total member count and role count
  3. Server Icon: Display the server's icon image (if available)

The information should be presented in a rich, colored message format with:

  • A clear title showing the server name
  • Organized sections using labeled fields
  • A timestamp showing when the information was retrieved
  • The server icon displayed as a thumbnail image
  • A distinctive color (blue, 0x3498db)

Technical Details

  • Use Python 3.8+
  • The bot should use slash commands (application commands)
  • Format timestamps in a readable way (e.g., "January 15, 2020")
  • Handle cases where the server has no icon gracefully

Test Cases

Create test file: test_serverinfo.test.py

  • When the /serverinfo command is invoked, it responds with a formatted message containing server details @test
  • The response includes the server name in the title @test
  • The response includes member count and role count as separate fields @test
  • The response displays the server icon as a thumbnail when available @test
  • The response has a blue color (0x3498db) @test

Dependencies { .dependencies }

py-cord { .dependency }

Provides Discord bot functionality and API wrapper.

Implementation

@generates

API

import discord
from discord.ext import commands

bot = discord.Bot()

@bot.slash_command(name="serverinfo", description="Display information about the server")
async def serverinfo(ctx):
    """Display comprehensive server information in a formatted message."""
    pass

# Entry point to run the bot
def main():
    """Main function to start the bot."""
    pass