This commit is contained in:
Aslan 2025-12-28 17:57:58 +01:00
parent 0f6e387f30
commit 05875413f9
2 changed files with 48 additions and 12 deletions

View file

@ -1,7 +1,12 @@
import { MatrixClient } from "matrix-js-sdk";
import type { ICallbackStore } from "../types.js";
import { config } from "../../config.js";
import { getLevel, getUserById, getUserName } from "../../helpers.js";
import {
getLevel,
getUserById,
getUserFromMention,
getUserName,
} from "../../helpers.js";
import { state } from "../../store/store.js";
import type { IUser } from "../../store/types.js";
let client: MatrixClient;
@ -29,7 +34,10 @@ const registerModuleUser = (
const onMe = (text: string, roomId: string, sender: string) => {
const mention = text.split(" ")[1];
const user = mention ? getUserById(mention) : getUserById(sender);
const user = mention ? getUserFromMention(mention) : getUserById(sender);
if (!user) {
return;
}
const level = getLevel(user.experience);
client.sendHtmlMessage(