CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-py-cord

A modern, async-ready Python API wrapper for Discord with comprehensive bot development features

Overall
score

93%

Overview
Eval results
Files

task.mdevals/scenario-6/

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

Install with Tessl CLI

npx tessl i tessl/pypi-py-cord

tile.json