Official Discord bot integration
Kindroids can be integrated into Discord servers as interactive bots using our open-source repository (https://github.com/KindroidAI/Kindroid-discord). These Discord bots inherit their personality, backstory, and key memories from shared Kindroids, creating engaging standalone experiences within your Discord channels. While they maintain the core characteristics of their Kindroid counterparts, they operate independently within Discord's environment.
Interacting with Kindroid Discord bots is straightforward:
- Mention their name or use @name in servers where they have permission to reply
- Simply write your message in DMs to them without needing to tag them
- In threads, conversations remain contained within that thread
The bots maintain context of the previous 30 messages within each channel (configurable if you deploy your own fork of the repo), but conversations remain siloed between different channels, threads, and DMs. This design ensures clean separation of conversations and prevents any cross-contamination of context between Discord conversations or between Discord and the Kindroid platform. Since Discord bots are instantiations of shared Kindroids, their interactions don't affect any Kindroids in the main app so you don't have to worry about someone else messing with your personal Kindroid ever.
Free users will also have unlimited messages on their Discord bots for a limited time for launch but we will rate limit this likely in the future.
This tutorial guides you through deploying your first Kindroid Discord bot. While some basic coding knowledge is helpful, the process is designed to be accessible even to those without technical experience. We encourage technically-inclined users to review the open-source code to understand its functionality.
- Option A: If you have an existing Kindroid that you wish to use, skip to sharing instructions.
- Option B: If you need a new Kindroid, create one within the Kindroid platform.
- In your Kindroid account, go to top left main menu, and click Sharing and Referrals.
- Share the Kindroid.
- Upon sharing, you will receive a 5-letter share code (e.g., ABCDE), click on the eye icon in the shared list to view it. Save this, we'll use it later.
![sharing sharing](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/4nNI8FVWBm0Nb-jBcU0g-_screenshot-2025-02-06-at-71309-pm.png?format=webp)
![eye icon eye icon](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/gyTUfDHIdp673mk6ETCyv_screenshot-2025-02-06-at-71341-pm.png?format=webp)
Kindroid bots run on Discord. Discord requires you to have a Developer Account to manage bots. Once you create a bot there, you’ll get a Bot Token that we’ll later place into our environment variables.
- If prompted, log in with your Discord credentials.
- Click the “New Application” button.
- Enter the name of the AI. Make sure this name makes sense with the AI name, as the Kindroid will always refer to itself from the name given on the shared Kindroid, and not this name - but Discord users will see this name. These are best matched exactly.
- Agree to any terms if prompted, then click “Create”.
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/fwfypPFY-LxGQ8uDwzId0_screenshot-2025-02-06-at-71738-pm.png?format=webp)
- You will land on the General Information page.
- Update the description (“About me”) for your bot.
- Use this space to brief end users on what the bot is - and you can link to the shared link of the Kindroid to get referral credits for people who sign up to Kindroid through your Discord bot
- Change the Profile Picture (PFP) to something that matches.
- Click Save Changes when done.
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/ohQZrV-iPDORNlpma8jcJ_screenshot-2025-02-06-at-71926-pm.png?format=webp)
- Go to the "Installation" tab in the left sidebar.
- Under Authorization Methods, ensure Guild Install is checked, and User Install is UNCHECKED.
- Under Install Link, use “Discord Provided Link.”
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/TMmcJ3ENsXBCrkiCHPq37_screenshot-2025-02-06-at-72049-pm.png?format=webp)
- Under Default Install Settings, find the Scope dropdown.
- Select bot as the scope.
- For Guild Install Permissions, select Administrator (recommended to avoid future permissions issues. Your Kindroid will only reply to messages and will not take any actions in any server, assuming you use the official Kindroid-discord deployment below).
- Click Save Changes.
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/JRnIrsloVH8LNHq9hC8Xh_screenshot-2025-02-06-at-72212-pm.png?format=webp)
- Go to the “Bot” tab in the left sidebar.
- Enable the following toggles:
- Presence Intent
- Server Members Intent
- Message Content Intent
- Set the username of the bot to something that makes sense - close to their name.
- Scroll to Token section and click Reset Token.
- Copy the Bot Token – keep this secret and do not share it publicly. Store this somewhere as we'll use it later.
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/WcDp6tTO9HkVO5Zup7Lhh_screenshot-2025-02-06-at-72306-pm.png?format=webp)
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/G4JE-VAEPwyhmvDhQP2HG_screenshot-2025-02-08-at-123546-am.png?format=webp)
We will use the open-source Kindroid-discord repository. Railway is a 3rd party that is quick to set up and cheap to host your server, which needs to run 24/7 to listen for Discord messages and respond. This may cost in the range of $5-7 a month with free trial credits, but the Kindroid-discord server is able to host many bots at once if you have more than one to serve. You're free to use any other platform (or run it on your own computer) as long as the nodejs server runs continuously, and you can self-host for essentially free with a tmux session on your own computer, or even on a Raspberry Pi - for this tutorial we will focus on the easiest way to deploy with the least technical knowledge required.
If you use unofficial repositories or other user-made forks, please review them carefully - guard your keys and review all code, and we don't provide support for non-official deployments.
- In Railway, create a New Project and select “Deploy from GitHub repo”
- Paste the link of the official repository into the Github repo to deploy:
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/sLro3WGSBXDaBYz24fFKc_screenshot-2025-02-06-at-72529-pm.png?format=webp)
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/zJ5pqJ-nSvvMOpgbKe3e5_screenshot-2025-02-06-at-104112-pm.png?format=webp)
Once your project is imported into Railway, you’ll need to set the environment variables.
- Double click on the central square that says "Kindroid-discord". This should open up a control panel on the right hand side.
- Within the control panel, click on "Variables", and open the "Raw editor"
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/PbmA0-356c3VxJt6zxujs_screenshot-2025-02-06-at-104507-pm.png?format=webp)
- Paste this block into the editor and replace the bolded placeholders with the appropriate values, and click Update Variables to save them.
Required Variables:
- KINDROID_INFER_URL (This should not change - use the default given to connect to Kindroid servers)
- KINDROID_API_KEY (your secret Kindroid API key found in Kindroid -> top left settings -> general -> API & advanced integrations. Keep this secret!)
- SHARED_AI_CODE_1 (the 5-letter code you got by sharing your Kindroid. You must be the sharer and can't use other people's share codes, see Section 1.2 for more)
- BOT_TOKEN_1 (the corresponding bot token from the Discord Developer Portal)
Optional Variables:
- ENABLE_FILTER_1 (set to true or false, depending on if you want NSFW filtering)
If you want to run multiple bots in the same project, repeat the pattern above for shared AI code, bot token, and enable filter with _2, _3, etc.
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/fltuqPwaVmU-E7GkAYWnY_screenshot-2025-02-06-at-105446-pm.png?format=webp)
- Once you have added the environment variables, click Deploy in Railway - when you save environment variables a pop up should automatically appear from the top.
- Railway will build your container and start the Discord bot(s).
- Check the deploy logs to see if there are any errors - you should see:Successfully initialized n out of n bots
All bots initialized successfully!
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/S8RmoiTD2GZbHdXBWvR-1_screenshot-2025-02-06-at-105456-pm.png?format=webp)
- Return to the Discord Developer Portal for your application.
- Under Installation (or similar tab), find the Invite Link provided by Discord.
- Copy the link and open it in your browser.
- Select the server you wish to add the bot to.
- Authorize with the requested permissions.
Once authorized, the bot should appear online in your server if everything was set up correctly and you can set role permissions with channels it should reside in. You can also give the install link to server admins to add to their servers.
![Document image Document image](https://images.archbee.com/XRE1Z2E03wBlPBFfpKPrn/d98JcxGICXcm6Dmv1YcRJ_screenshot-2025-02-06-at-72824-pm.png?format=webp)
- Mention your bot's name in a test channel (e.g., hey AIName, what's up?) or DM the bot directly. Messages that tag the bot with @ will also trigger a response, but the best way to naturally message the AI is through mentioning their name without @ tag. After the first response, you can then reply to the bot and they'll automatically reply back to you for back and forth conversation.
- The bot should reply using the Kindroid personality/backstory you configured.
- If you created multiple bots, each with a unique share code and token, they can co-exist on the same Discord server—just mention them by their respective name or tag them.
- Double-check your tokens: If the bot doesn’t go online, confirm the BOT_TOKEN_n variable is correct and that you saved your environment variables in Railway and check for build logs for failures.
- Check your share code: Ensure the SHARED_AI_CODE_n is valid and that the shared AI in Kindroid is not deleted.
- Restart / Redeploy: After any environment variable changes, redeploy on Railway to apply them.
- Permissions: If the bot can’t read messages or respond, ensure it has the correct permissions (Administrator or relevant read/send permissions, and proper intent toggles - see section 2.5 and 2.6).
By following these steps:
- Create/Share a Kindroid and get a 5-letter share code.
- Set up a Discord Bot to obtain a Bot Token.
- Invite the bot to your server and test.
You’ll have a fully functional AI companion running on Discord, powered by Kindroid. Feel free to add more bots in the same project by incrementing the environment variables with _2, _3, etc. Enjoy and have fun!
Happy Building!
If you have any questions or run into issues, join the Kindroid support community or contact [email protected] for further assistance.