mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-05 08:35:39 -05:00
52 lines
1.1 KiB
JavaScript
52 lines
1.1 KiB
JavaScript
const CommandError = require('../CommandModules/command_error')
|
|
const CharacterAI = require('node_characterai');
|
|
const characterAI = new CharacterAI();
|
|
// won't work on server nodejs. only works on windows I guess :|
|
|
|
|
async function start() {
|
|
await characterAI.authenticateAsGuest();
|
|
}
|
|
|
|
async function ask(key, message) {
|
|
const characterId = key;
|
|
|
|
const chat = await characterAI.createOrContinueChat(characterId);
|
|
const response = await chat.sendAndAwaitResponse(message, true);
|
|
|
|
return response.text
|
|
}
|
|
|
|
module.exports = {
|
|
start,
|
|
ask,
|
|
name: 'cai',
|
|
|
|
execute (context) {
|
|
const bot = context.bot
|
|
const message = context.arguments.join(' ')
|
|
|
|
|
|
}
|
|
};
|
|
/*
|
|
const CharacterAI = require('node_characterai');
|
|
const characterAI = new CharacterAI();
|
|
|
|
async function start() {
|
|
await characterAI.authenticateAsGuest();
|
|
}
|
|
|
|
async function ask(key, message) {
|
|
const characterId = key;
|
|
|
|
const chat = await characterAI.createOrContinueChat(characterId);
|
|
const response = await chat.sendAndAwaitResponse(message, true);
|
|
|
|
return response.text
|
|
}
|
|
|
|
module.exports = {
|
|
start,
|
|
ask
|
|
};
|
|
```*/ |