Build a Discord bot with ChatGPT or Claude

A Discord bot that answers slash commands, like /roll for dice or /leaderboard for your server's scores, needs an interactions endpoint: an address Discord sends each command to. ChatGPT or Claude can set that endpoint up on Tessryx and write the workflows that decide each reply.

Pressing a button or picking from a menu on one of the bot's messages also goes to that endpoint.

What to ask your AI

Connect Tessryx to ChatGPT or Claude, then paste one of these, or say it your own way.

  • A dice roller
    “make a discord bot with a /roll command that rolls dice like 2d6+3 and shows each die and the total”
  • Points and a leaderboard
    “make a discord bot for our server with /point @someone to give them a point and /leaderboard for the top 10. let me fix a score by hand if someone games it”
  • Game night sign-ups
    “every friday at noon have the bot post this week's game night in #events with in and out buttons, and add a /whoscoming command that lists who's in”

What Tessryx runs for you

  • Verified interactions

    Discord signs every interaction, and your endpoint checks the signature with your application's Public Key. A request without a valid one is refused with a 401, and Tessryx replies to the PING Discord sends when you save the address.

    Webhooks from Slack, Stripe, GitHub and more
  • The reply to each command

    Whatever the workflow returns is the reply: a new message, or an edit to the message whose button someone pressed. It sees the command's options and the user who used it.

    Workflows
  • Calls to Discord's API

    Anything the bot posts outside a reply goes through Discord's API, called from an integration with the bot token kept in Secrets.

    API integrations
  • Posts on a schedule

    At the times you set, like Friday at noon in your timezone, a schedule starts a workflow and the bot posts in a channel.

    Cron jobs and scheduled tasks
  • Slower answers

    Discord gives an interaction 3 seconds. For anything slower, the bot first shows that it's thinking, and a background run fills in the answer by editing that reply.

    Background tasks
  • Scores kept in records

    The leaderboard and the game-night list are records the commands read and write. You can open either one in your dashboard to fix a score or a name by hand.

    Read and write records

What it costs

Plan: Free

A server using 200 commands a day, each answered at once, comes to about 6,000 credits a month. Commands that answer in under 10 seconds are 1 credit apiece, and a reply finished in the background adds another.

That fits inside the free plan's monthly 10,000 credits, along with one scheduled job, run at most once an hour. Pro costs $20 a month and allows 10 scheduled jobs that can run every 15 minutes, with 100,000 credits.

What it can't do yet

  • Discord reaches the bot only through its interactions endpoint, when someone uses one of its commands or the buttons on its messages, and a schedule can start it too. New messages and members joining a server are never sent there.

    No "run when something changes" triggers
  • Integrations send JSON to public addresses only, which suits Discord's API for messages and embeds. Attaching a file takes a multipart body they can't send; an image can go in an embed by its public address.

    Integrations send JSON, and only to the public internet

Questions

Can the bot read every message in a channel?

The bot can't read them: channel messages only go to bots that keep a live connection to Discord's gateway, and Tessryx doesn't keep one.

What do I set up in Discord?

You make an application in Discord's Developer Portal. Its Public Key and bot token go in Tessryx Secrets, and your endpoint's address goes in its Interactions Endpoint URL. Your AI can register the slash commands by calling Discord's API, using the bot token.

Can other servers add the bot?

Discord gives you an invite link for the bot, and commands from every server that adds it reach the same endpoint.

All features

Connect your AI and build it

Free to start, no credit card. Bring the AI you already use.