1.0.9 • Published 1 year ago

character.ai-ts v1.0.9

Weekly downloads
-
License
GNU
Repository
github
Last release
1 year ago

Character.AI

img.png

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.

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago