character.ai-ts
v1.0.9
Published
Unofficial Javascript/Typescript wrapper for character.ai
Downloads
49
Readme
Character.AI
Unofficial Javascript/Typescript Wrapper for character.ai
Initialize a Client and Login
import Log_in,{Client} from 'character.ai-ts';
let client:Client = await Log_in("token") // returns the Client
the default of the second arg of innit
is false, will start a new chat if it set to true, if there is no previous history between character and client it will create one
const character = await client.init("characterId",true) // returns a Character and sets client's current character to it
const msg :Msg = await client.sendMsg("Hello!") // returns a Message Object
const History : Array<Msg> = client.history // returns an Array of Messages
to get user info
const user = client.me // returns a User Object
lookFor returns an Array of Characters that has the same name as the first arg the second argument sorts the array by the amount of interactions the characters has, the default is "score"
const characters : Array<char> = await client.lookFor("characterName","interactions") // returns an Array of Characters
This project was created using bun init
in bun v0.5.7. Bun is a fast all-in-one JavaScript runtime.