vicuna-7b· LMSYS
Arena Human Preference 55K
code for a basic discord bot with commands hello, ping, and dice
- User
code for a basic discord bot with commands hello, ping, and dice
- Assistant
Here is an example of a basic Discord bot with commands "hello", "ping", and "dice":
import os import discord from discord.ext import commands bot = commands.Bot(command_prefix='!') @bot.command() async def hello(ctx): await ctx.send("Hello!") @bot.command() async def ping(ctx): await ctx.send("Pong!") @bot.command() async def dice(ctx): roll = discord.utils.git_random_int(1, 6) await ctx.send(f"You rolled {roll}.") bot.run(os.getenv("DISCORD_TOKEN"))This bot will respond to the
/hellocommand with "Hello!", the/pingcommand with "Pong!", and the/dicecommand with a random number between 1 and 6.Note that you will need to have a Discord API token in the
DISCORD_TOKENenvironment variable in order for the bot to run.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.