This is code that I came up with which allows me to use discord to talk to a characterai character as long as the bot is up and running. I made it primarily for my own use case however feel free to use it as you like.
please refer to kramcat's documentation to get your characterai api tokens needed to run the program.
How to use:
-
Create a folder
-
Create a Python file
-
Paste in the code from my python file into the newly created one
-
Replace the proper tokens with their actual values
-
Run the program from within the folder
-
The folder will also house the chat history that gets created when speaking to the bot