API Documentation
Official Discord bot integration
discord bot integration overview 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 creating kindroid bots on discord (tutorial length 15 30 minutes) 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 1\ create or use an existing kindroid & share the kindroid 1 1 find or make a kindroid 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 1 2 share the kindroid 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 important if you want to use someone else’s shared kindroid, first download it, then re share it under your own account this ensures you have full control (editing backstory/personality, etc, which will live update all discord bots made from this shared kindroid in real time) the api connection will fail if the shared code isn't owned by you 2\ create a discord bot (get the bot token) 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 2 1 go to the discord developer portal navigate to the discord developer portal if prompted, log in with your discord credentials 2 2 create a new application 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” 2 3 customize bot details 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 2 4 set up installation method 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 ” 2 5 set default install settings 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 2 6 enable intents & generate bot token 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 3\ deploy the bot on railway 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 3 1 get started on railway sign in to an account on railway important note railway does an automatic check on your github sign in and grants different trial statuses based on how verified/legitimate your github account looks if your github is new, you may be on the "limited free trial" plan, yellow color and can't deploy code in that case you need to upgrade to the $5/mo hobby plan to continue (or opt for run/host the code locally using npm start if you're technically proficient) if your github account is aged, you'll see trial status as green/full trial if so, you don't need a card on file to have $5 of free credits and you can deploy code immediately see https //docs railway com/reference/pricing/free trial https //docs railway com/reference/pricing/free trial 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 https //github com/kindroidai/kindroid discord 3 2 configure environment variables 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 " paste this block into the editor and replace the bolded placeholders with the appropriate values, and click update variables to save them kindroid infer url=https //api kindroid ai/v1/discord bot kindroid api key= your kindroid api key here shared ai code 1= your shared code 1 here bot token 1= your discord bot token 1 here enable filter 1= true 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 official discord bot integration docid\ rlluzotf4dsbpr1hupyg6 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 3 3 re deploy after saving 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! 4\ add your bot to a discord server 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 5\ test your kindroid bot 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 troubleshooting & tips 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) conclusion 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 deploy the kindroid discord repository on railway with your api key , bot token , and share code 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 hello\@kindroid ai for further assistance