This tutorial will guide you through creating a completely free AI chatbot that can be used via Discord. The bot will be deployed to Vercel, which is a free service, and will use the Google AI API for chat message generation. To start, you'll need to create a Discord Application and obtain the application's credentials, including a bot token. You'll also need to invite the bot to a Discord server to test it. Next, you'll create a new Discraft project, which is a framework for Discord bots that allows you to easily create serverless Discord bots. You'll then collect environment variables, including your Discord Public Key, App ID, and Bot Token, as well as your Google AI API Key. After collecting these secrets, you'll deploy the bot code to Vercel using the Vercel CLI. Finally, you'll configure the bot on Vercel and Discord, including setting environment variables and configuring the Interactions Endpoint URL. Once you've completed these steps, you can use your new bot by typing /ping in the Discord message box. If everything is working correctly, you'll see a response: Pong from Vercel!
dev.to
dev.to
