Skip to content
TheChatArchiveThe Chat Archive
Claudeclaude-3-7-sonnet-20250219-thinking-32k· AnthropicHugging Face LMArena Human Preference 140K

Build me a basic discord bot.

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Coherecommand-a-03-2025’s answer.
  1. User

    Build me a basic discord bot.

  2. Claude Assistant

    Here's a basic Discord bot using Python and the discord.py library:

    import discord
    from discord.ext import commands
    import os
    
    # Set up bot with command prefix
    intents = discord.Intents.default()
    intents.message_content = True
    bot = commands.Bot(command_prefix='!', intents=intents)
    
    @bot.event
    async def on_ready():
        print(f'{bot.user.name} has connected to Discord!')
    
    @bot.command(name='hello')
    async def hello(ctx):
        await ctx.send(f'Hello, {ctx.author.mention}!')
    
    @bot.command(name='ping')
    async def ping(ctx):
        await ctx.send(f'Pong! Latency: {round(bot.latency * 1000)}ms')
    
    # Replace 'YOUR_BOT_TOKEN' with your actual bot token
    bot.run('YOUR_BOT_TOKEN')
    

    Would you like me to explain or break down this code?

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.