|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
import { db, Channel } from "../database.ts";
|
|
|
|
|
import { BotEmitter } from "@wackford/mod.ts";
|
|
|
|
|
import { AIs } from "../ai/index.ts";
|
|
|
|
|
import config from "../../config.json" assert { type: "json" };
|
|
|
|
|
import config from "../config.ts";
|
|
|
|
|
import blacklist from "../../blacklist.json" assert { type: "json" };
|
|
|
|
|
|
|
|
|
|
//const dirname = new URL(".", import.meta.url).pathname;
|
|
|
|
|
|
|
|
|
@ -19,7 +20,7 @@ export default function init() {
|
|
|
|
|
|
|
|
|
|
await bot.helpers.startTyping(message.channelId);
|
|
|
|
|
|
|
|
|
|
const res = await AIs[message.channelId.toString()].complete(user.username, message.content)
|
|
|
|
|
let res = await AIs[message.channelId.toString()].complete(user.username, message.content)
|
|
|
|
|
|
|
|
|
|
const history = channel.history ?? []
|
|
|
|
|
|
|
|
|
@ -35,6 +36,10 @@ export default function init() {
|
|
|
|
|
history
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
blacklist.forEach((val) => {
|
|
|
|
|
res = res.replaceAll(val, `${val[0]}${"\\*".repeat(val.length - 1)}`)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
await bot.helpers.sendMessage(message.channelId, {
|
|
|
|
|
content: `[${AIs[message.channelId.toString()].name}] ${res}`,
|
|
|
|
|
messageReference: {
|
|
|
|
|