Skip to content

A Discord bot that lets you chat with your Character.ai character, bringing them to life in conversation!

Notifications You must be signed in to change notification settings

JaimyTuin223/character.ai-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Character.ai discord bot (v2)

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.

Future plans

  • Character switching via slash command
  • Image generation
  • Calling

Code setup

Node modules

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

Bot token

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.

Character.ai Access token

This acccess token will be used to authenticate the requests used by the code.

  1. Go to https://character.ai/ in your browser.
  2. Open the developer tools. (F12, Ctrl+Shift+I, or Cmd+J)
  3. Go to the Application tab.
  4. Go to Storage and open the cookies dropdown.
  5. Inside this dropdown list open https://character.ai
  6. Find the HTTP_AUTHORIZATION entry and copy the value behind token.

image

Character ID

This replaces the old chat ID value, but is still retrieved the same, simply navigate to your character and copy the value behind /chat/. image

Deployment

To run the code and make your Discord bot available run the following command in an intergrated terminal.

  node index.js

Support

For support join the Ginger Productions Discord server.

About

A Discord bot that lets you chat with your Character.ai character, bringing them to life in conversation!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published