Make a FREE AI Chatbot with Discord + Vercel
Wow, it's been a while since I've posted! I've been working on all kinds of tools, fun side projects, and frameworks. But here I am! So, let's get started. What are we making? In this tutorial, we will make a completely free AI chatbot that you can use via Discord. By completely free, I mean completely free! It will cost you nothing to create and host the bot or generate AI chat messages. Note: This tutorial assumes that you are a developer. If you aren't a programmer, you can probably make it through, but it might be challenging. This tutorial also assumes that you have Node.js and npm installed on your device. I would very much recommend having Bun installed too, though it isn't required. All terminal command examples are for Linux. What is Discord? Discord is a popular platform for communication. It combines text, voice, and video chat in customizable servers or direct messages. It's widely used by gamers, communities, and developers to connect and collaborate in real time. If you've used Slack or Signal, it should feel pretty familiar. Something cool about Discord is the Discord Developer Portal, which allows developers to create Discord Applications. An application is like a Discord user (except it's a bot) that can do handy things for you within Discord. For example, it could keep your community engaged with daily games, or it could post in a Discord channel every time you make a new dev.to post. If you don't have a Discord account yet, you will need to create one. Why this tutorial is special ✨ Usually, when you make a Discord bot, you have to run it on a server that costs you money. Or, of course, you can run it on your laptop, which is super annoying. Nobody wants a bunch of bot services always running on their PC; plus, when you lose internet, the bot will stop working. In this tutorial, we are deploying a “serverless” bot to Vercel. Vercel will spin up a little serverless function only when your bot is needed, keeping your PC clean and providing a stable environment for your bot. Of course, the greatest benefit: Vercel is completely free! You will need a free account to use Vercel. You can sign up at vercel.com. Google AI This bot will be using the Google AI API for AI chat message generation. I'm going to assume that most of you have a Google account. If you don't, you should make one at google.com
Wow, it's been a while since I've posted! I've been working on all kinds of tools, fun side projects, and frameworks. But here I am!
So, let's get started.
What are we making?
In this tutorial, we will make a completely free AI chatbot that you can use via Discord. By completely free, I mean completely free! It will cost you nothing to create and host the bot or generate AI chat messages.
Note: This tutorial assumes that you are a developer. If you aren't a programmer, you can probably make it through, but it might be challenging.
This tutorial also assumes that you have Node.js and npm installed on your device. I would very much recommend having Bun installed too, though it isn't required.
All terminal command examples are for Linux.
What is Discord?
Discord is a popular platform for communication. It combines text, voice, and video chat in customizable servers or direct messages. It's widely used by gamers, communities, and developers to connect and collaborate in real time. If you've used Slack or Signal, it should feel pretty familiar.
Something cool about Discord is the Discord Developer Portal, which allows developers to create Discord Applications. An application is like a Discord user (except it's a bot) that can do handy things for you within Discord. For example, it could keep your community engaged with daily games, or it could post in a Discord channel every time you make a new dev.to post.
If you don't have a Discord account yet, you will need to create one.
Why this tutorial is special ✨
Usually, when you make a Discord bot, you have to run it on a server that costs you money. Or, of course, you can run it on your laptop, which is super annoying. Nobody wants a bunch of bot services always running on their PC; plus, when you lose internet, the bot will stop working.
In this tutorial, we are deploying a “serverless” bot to Vercel. Vercel will spin up a little serverless function only when your bot is needed, keeping your PC clean and providing a stable environment for your bot.
Of course, the greatest benefit: Vercel is completely free!
You will need a free account to use Vercel. You can sign up at vercel.com.
Google AI
This bot will be using the Google AI API for AI chat message generation.
I'm going to assume that most of you have a Google account. If you don't, you should make one at google.com