Skip to content

Commit d21b21f

Browse files
cernodileturt2live
authored andcommitted
Inline replies Discord->Matrix
1 parent 2cdc84d commit d21b21f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/bot.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,20 @@ export class DiscordBot {
10051005
formatted_body: result.formattedBody,
10061006
msgtype: result.msgtype,
10071007
};
1008+
if (msg.reference) {
1009+
const storeEvent = await this.store.Get(DbEvent, {discord_id: msg.reference?.messageID})
1010+
if (storeEvent && storeEvent.Result)
1011+
{
1012+
while(storeEvent.Next())
1013+
{
1014+
sendContent["m.relates_to"] = {
1015+
"m.in_reply_to": {
1016+
event_id: storeEvent.MatrixId.split(";")[0]
1017+
}
1018+
};
1019+
}
1020+
}
1021+
}
10081022
if (editEventId) {
10091023
sendContent.body = `* ${result.body}`;
10101024
sendContent.formatted_body = `* ${result.formattedBody}`;

0 commit comments

Comments
 (0)