tessl install tessl/pypi-py-cord@2.6.0A 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%
Build a Discord bot that logs administrative actions in a server to help server moderators track changes.
Create a Discord bot with a /recent_actions slash command that:
@generates
import discord
from discord.ext import commands
class AuditLogger(commands.Cog):
"""Cog for logging guild administrative actions."""
def __init__(self, bot: commands.Bot):
"""Initialize the audit logger."""
pass
@commands.slash_command(name="recent_actions", description="Display recent administrative actions")
async def recent_actions(self, ctx: discord.ApplicationContext):
"""Fetch and display the 5 most recent administrative actions."""
pass/recent_actions is invoked in a guild with no recent actions, the bot responds with a message indicating no actions found @test/recent_actions is invoked in a guild with 3 role creation actions, the bot displays those 3 actions with their timestamps and responsible users @test/recent_actions is invoked in a guild with 5 member kick actions that include reasons, the bot displays all 5 actions with their reasons @testProvides Discord bot functionality and audit log access.