Part 4: Create Our Own Discord Bot
Build a custom Discord bot and connect it to our n8n AI automation.
15. (Optional) Create Our Own Discord Bot
In this optional advanced section, we will create our own Discord bot.
The bot will allow our n8n workflow to send messages to a Discord server automatically.
You submit request → AI processes it → Our Discord bot sends the result to the Discord channel.
15.1 Open Discord Developer Portal
Open the Discord Developer Portal.
- Create a new application.
- Give your application a name.
- Open the application.
15.2 Create the Bot
- Open the Bot section of your Discord application.
- Create the bot.
- Give the bot a suitable name.
- Set a profile picture if required.
Example Bot Name
15.3 Install the Bot
Configure the bot's installation settings and invite it to your Discord server.
Required Permissions
- View Channels
- Send Messages
Give only the permissions that the bot actually needs.
15.4 Protect the Bot Token
Important Security Warning
Your Discord bot token is private.
Never share it publicly.
- Do not upload it to GitHub.
- Do not post it in Discord.
- Do not put it in screenshots.
- Do not put it directly into public source code.
Store the bot credentials securely using the n8n credential system.
15.5 Connect the Bot to n8n
After the bot has been created and invited to the Discord server, configure the Discord node in n8n.
- Open the Discord node.
- Create or select the required Discord credential.
- Configure the server.
- Select the Discord channel.
- Configure the message.
15.6 Final Workflow
15.7 Example Bot Message
15.8 Optional Challenge
Try modifying the bot message so that it automatically includes:
- Student name
- Student email
- Department
- Subject
- AI-generated email
Can you make the Discord bot produce a clean notification automatically every time a student submits the form?
Ready for Part 5?
In the final part, we will run n8n locally using Docker and expose it using a Cloudflare Quick Tunnel.