This bot allows you to communicate with your character.ai bots inside a discord chat, making use of node_characterai.
Note
This branch is in development and is very likely to have issues in the code at this point in development.
- Character switching via slash command
- Image generation
- Calling
Installing the correct packages can be done with the following npm command:
npm i
To be able to run this code locally your device will need to have Node.JS installed, which can be found here
Make sure to create a new file named config.json
in the main file path of your project! Here you can store your bot token for the code to use.
{
"token": "Discord bot token",
"authToken": "C.ai Access token",
"defaultCharacter": "C.ai Character ID"
}
The .gitignore
file can be removed from your project folder.
This acccess token will be used to authenticate the requests used by the code.
- Go to https://character.ai/ in your browser.
- Open the developer tools. (
F12
,Ctrl+Shift+I
, orCmd+J
) - Go to the
Application
tab. - Go to
Storage
and open thecookies
dropdown. - Inside this dropdown list open
https://character.ai
- Find the
HTTP_AUTHORIZATION
entry and copy the value behind token.
This replaces the old chat ID value, but is still retrieved the same, simply navigate to your character and copy the value behind /chat/
.
To run the code and make your Discord bot available run the following command in an intergrated terminal.
node index.js
For support join the Ginger Productions Discord server.