Fixes
This commit is contained in:
parent
05875413f9
commit
00211a604f
3 changed files with 9 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ import type { ICallbackStore } from "../types.js";
|
|||
import { config } from "../../config.js";
|
||||
import { load, save, state } from "../../store/store.js";
|
||||
import type { TRole } from "../../store/types.js";
|
||||
import { getUserFromMention } from "../../helpers.js";
|
||||
|
||||
let client: MatrixClient;
|
||||
|
||||
|
|
@ -36,9 +37,9 @@ const registerModuleAdmin = (
|
|||
|
||||
const onSetRole = async (text: string, roomId: string) => {
|
||||
const words = text.split(" ");
|
||||
const userId = words[1];
|
||||
const mention = words[1];
|
||||
const role = words[2] as TRole;
|
||||
const user = state.users.find((user) => user.id === userId);
|
||||
const user = getUserFromMention(mention);
|
||||
|
||||
if (!user || !role) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ const onAI = async (text: string, roomId: string, sender: string) => {
|
|||
alts: alts,
|
||||
} as IAdminInstructions;
|
||||
|
||||
textMod = `Admin Instructions:\n${instructions}\nPrompt:\n${textMod}`;
|
||||
textMod = `Admin Instructions:\n${JSON.stringify(instructions)}\nPrompt:\n${textMod}`;
|
||||
|
||||
const responseAI = await getTextGemini(textMod);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue