This repository has been archived on 2026-10-25. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Sable/src/app/utils/sendFeedbackToUser.ts
T

13 lines
419 B
TypeScript

import { MatrixEvent, Room } from 'matrix-js-sdk';
export function sendFeedback(msg: string, room: Room, userId: string) {
const localNotice = new MatrixEvent({
type: 'm.room.message',
content: { msgtype: 'm.notice', body: msg },
event_id: `~sable-feedback-${Date.now()}`,
room_id: room.roomId,
sender: userId,
});
room.addLiveEvents([localNotice], { duplicateStrategy: 'ignore' } as any);
}