forked from cadence/out-of-your-element
Compare commits
No commits in common. "8676a736204b8cdf8831aad4ca32f7ebf2f7a8be" and "a66b93ed2625dacf7cb5f24191c1baa2f8f7fdf2" have entirely different histories.
8676a73620
...
a66b93ed26
3 changed files with 9 additions and 17 deletions
|
|
@ -471,7 +471,6 @@ async function checkWrittenMentions(content, senderMxid, roomID, guild, di) {
|
|||
// @ts-ignore - typescript doesn't know about indices yet
|
||||
content: content.slice(0, writtenMentionMatch.indices[1][0]-1) + `@everyone` + content.slice(writtenMentionMatch.indices[1][1]),
|
||||
ensureJoined: [],
|
||||
/**@type {DiscordTypes.AllowedMentionsTypes[]}*/ // @ts-ignore - TypeScript is for whatever reason conviced that "everyone" cannot be assigned to AllowedMentionsTypes, but if you „Go to Definition”, you'll see that "everyone" is a valid enum value.
|
||||
allowedMentionsParse: ["everyone"]
|
||||
}
|
||||
}
|
||||
|
|
@ -544,7 +543,6 @@ async function getL1L2ReplyLine(called = false) {
|
|||
async function eventToMessage(event, guild, channel, di) {
|
||||
let displayName = event.sender
|
||||
let avatarURL = undefined
|
||||
/**@type {DiscordTypes.AllowedMentionsTypes[]}*/ // @ts-ignore - TypeScript is for whatever reason conviced that neither "users" no "roles" cannot be assigned to AllowedMentionsTypes, but if you „Go to Definition”, you'll see that both are valid enum values.
|
||||
const allowedMentionsParse = ["users", "roles"]
|
||||
/** @type {string[]} */
|
||||
let messageIDsToEdit = []
|
||||
|
|
|
|||
|
|
@ -211,9 +211,6 @@ async event => {
|
|||
if (utils.eventSenderIsFromDiscord(event.sender)) return
|
||||
const messageResponses = await sendEvent.sendEvent(event)
|
||||
if (!messageResponses.length) return
|
||||
if (event.content["m.relates_to"]?.rel_type === "m.thread"){
|
||||
console.log("thread event spotted")
|
||||
}
|
||||
if (event.type === "m.room.message" && event.content.msgtype === "m.text") {
|
||||
// @ts-ignore
|
||||
await matrixCommandHandler.execute(event)
|
||||
|
|
|
|||
21
src/types.d.ts
vendored
21
src/types.d.ts
vendored
|
|
@ -190,12 +190,11 @@ export namespace Event {
|
|||
format?: "org.matrix.custom.html"
|
||||
formatted_body?: string,
|
||||
"m.relates_to"?: {
|
||||
event_id?: string
|
||||
is_falling_back?: bool
|
||||
"m.in_reply_to"?: {
|
||||
"m.in_reply_to": {
|
||||
event_id: string
|
||||
}
|
||||
rel_type?: "m.replace"|"m.thread"
|
||||
rel_type?: "m.replace"
|
||||
event_id?: string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -211,12 +210,11 @@ export namespace Event {
|
|||
info?: any
|
||||
"page.codeberg.everypizza.msc4193.spoiler"?: boolean
|
||||
"m.relates_to"?: {
|
||||
event_id?: string
|
||||
is_falling_back?: bool
|
||||
"m.in_reply_to"?: {
|
||||
"m.in_reply_to": {
|
||||
event_id: string
|
||||
}
|
||||
rel_type?: "m.replace"|"m.thread"
|
||||
rel_type?: "m.replace"
|
||||
event_id?: string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -248,12 +246,11 @@ export namespace Event {
|
|||
},
|
||||
info?: any
|
||||
"m.relates_to"?: {
|
||||
event_id?: string
|
||||
is_falling_back?: bool
|
||||
"m.in_reply_to"?: {
|
||||
"m.in_reply_to": {
|
||||
event_id: string
|
||||
}
|
||||
rel_type?: "m.replace"|"m.thread"
|
||||
rel_type?: "m.replace"
|
||||
event_id?: string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue