Hello World
Part one of I build a DND DM Bot to play a campaign on discord.
Guide:
https://grantbuildswithai-creator.github.io/guides/ai-dungeon-master/
Read the transcript
Lightly edited for readability: mis-heard words fixed and filler words trimmed. Words in [brackets] were unclear in the recording.
Welcome to episode one of Grant Builds With AI. I'm Grant, and I'm trying to build things.
A little bit of background. I have always been impressed with people who can start projects and take them to completion. I have not been that person as much in the past, and so, off we go! Maybe publishing this podcast is me trying to set up a little, I don't know, external accountability. I don't know if anyone's gonna listen to this, except maybe people that I forced to, and maybe my mom. So we'll go from there.
I am a middle-aged guy, father, two teenagers, and I think it's always good to have hobbies. So here we go. I do not have a background in IT. My background is actually in healthcare. But I've always just really been impressed by people that can work with software and have IT skills. I've taken a couple small runs at trying to, quote-unquote, code. I tried to do a website with Java maybe 10 or 15 years ago, and I've watched my kids try to program with Scratch and do some Python stuff. So I've taken a run at that a couple times and just never got beyond printing "hello."
But I've been using some of the AI tools over the last two, three years, mostly as a research assistant, and I kept hearing about how you can do more with it. I think my big thing is, I started getting the paid subscriptions to both ChatGPT and Claude, and I have to say, really, with the Claude one, something clicked, and I was able to start building things.
So, here we go. Episode one. Let me just tell you what the end product is. I currently have up and running, on my Discord server, a Discord bot that's running 24/7. I can log in and talk, and it is running a D&D campaign, and it's going really well. My brother and my cousin have also logged in with their accounts and are playing their characters. We kind of play asynchronously. That's going really well.
So, how'd I get there? The inspiration came from the Games Done Quick conference this summer in Minneapolis. I met someone there who, I later saw, built basically what I built, and so I knew it was possible. So off I went, and I started basically with a prompt, going into Claude in the chat: "I would like to build a Discord bot powered by AI to run a D&D campaign on Discord." And away we went. I described to it that I wanted to learn through this process.
So this first part that I'm going to describe is actually kind of the long part, because I was pretty involved with the first bit of coding, in Python. I'm just going to describe this as part of episode one, and then it stops when I handed the project to Claude Code, and things actually just kind of took off. It was really this project that taught me how to use Claude and how to, quote-unquote, build with AI. At the time of this recording, this all started about a month ago. So the first two weeks of this, really, nothing got built, and then I turned it over to Claude Code and things just kind of started happening.
The first step was just so much copy-pasting. It was all online. I was just interacting with Claude through the web browser, in a chat, and it walked me through the idea. Then I started putting some of the pieces together. In the beginning, I downloaded Python, and then VS Code. Before doing any programming on the actual bot, Claude walked me through a bit of an introduction to Python. I did the "hello," and I did a couple other things, and then we got going on the Claude bot.
A lot of it was, it would generate the code, and I would copy-paste it into VS Code and then run it. I was spending a lot of time on it manually. It would recommend changing certain things, and I would go in and manually type them in, or delete certain sections and put other sections in. I found this really painful and really slow, but at the same time, it did help me get a better understanding of the infrastructure that I was building.
Before I started this, I didn't know anything about, like, Amazon Web Services. After the initial bit of coding, I opened up an EC2 instance on Amazon Web Services. I created an Amazon Web Services account, and you have to put a credit card onto it. I'm trying to keep everything free tier, so I think I'm using the small one with 30 GB of storage, and I think that's kind of the top of the free tier for now. Although I think it transitions. I don't think it's always free. After a year, I'll probably have to start paying some, and there's probably something I'm paying now that I'm not aware of, but it's not a lot.
But for me, everything was new. Before starting this project, I had no idea what SSH was. I had a very loose understanding of what an API key is. But Claude really walked me through that. In the beginning, I was the one interfacing through my laptop's PowerShell terminal, manually getting an SSH connection to my EC2 instance, which is running a Linux operating system, and learning how to walk around in there. All of that was just awesome for me. But it was purely educational on my part. Nothing was happening. It was just me exploring the infrastructure and getting an IT education, which really is just great.
Then I learned about API connections. There has to be a way for the software sitting on my instance to have permission to connect to Discord and control the DM's Discord account. And I made this one powered by Claude. I think it's currently pointed at the Sonnet 5 model. So I had to learn how to set up the API key so that my software, sitting on my EC2 instance, can contact Anthropic. I got to learn about making sure that my instance isn't just open to the internet, you know, that port 22 isn't open to 0.0.0.0. Right now, it just responds to my personal IP on my laptop. All those things were fascinating for me to learn about.
But really, nothing's getting done. So it was two weeks, maybe about an hour a day, of everything going really slow, and no product. Just a lot of education for me.
By the end of the two weeks, I was actually pretty elated. I did get it up and running, where I could log on to my Discord account with my laptop off, the DM bot would be online, and I could type in "hello," and it responded, "Hello, adventurer!" And I would type in, "I look around the tavern," and it would just start making something up and building an adventure for me. I moved around in it a little bit and did some things, and it was fun, and I was proud of myself. But the actual DM and the gameplay experience was kind of lame. It was nice, but not that interesting.
I kind of knew that the Claude model was just making things up as it was going, and it was storing it in its memory. And really, if I logged off and came back the next day, or even an hour later, it wasn't remembering the last things we were doing. So it really wasn't a finished product that you could use, but the infrastructure was there for it. And I knew that it needed more work: fleshing it out, expanding the software to do more things, to capture things and write them down somewhere, and give it instructions to read them, so that the campaign wasn't stored in the model's memory or the chat thread's memory, but somewhere external, on my server or on GitHub.
This was all stuff that I knew I could continue to have Claude walk me through, but I also knew I just really wasn't going to get anywhere. I could kind of tell I was probably months away from something I would want to share with a friend or with a relative. And that is what led me to turn this project over to Claude Code. And that's going to be episode two. Stay tuned!
This is the cliffhanger. At the end of this, I've built the infrastructure. I have a bot up and working. Everything's working, but it's just not very good. I do understand the setup, which is great, and I think it was worth it to go through this process. I had set up all the accounts. I had a good Discord account. I had a good Amazon Web Services account. I knew how to run an instance, and I'd set up payment plans for all of this. Oh yeah, I had to set up an API account for the Claude bot, because it can't be powered off my subscription, so I had to fund that. I think I put 40 dollars in to begin.
But it wasn't very good. I had built something, but it really wasn't very interesting, and no one would want to use it. So, you know what's next? Well, what's next is, I handed it over to Claude Code. And if you want to find out what happened after that, tune in for episode two. Like and subscribe. Although that would be YouTube. This is a podcast, so please follow and tell your friends. All right, bye.