WIP: feature: threads'n'forums #74
1 changed files with 2 additions and 2 deletions
|
|
@ -57,7 +57,7 @@ async function bridgeThread(event) {
|
|||
return true;
|
||||
}
|
||||
catch (e){
|
||||
if (e.message?.includes("50024")){
|
||||
if (e.message?.includes("50024")){ // see: https://docs.discord.com/developers/topics/opcodes-and-status-codes
|
||||
api.sendEvent(event.room_id, "m.room.message", {
|
||||
body: "Hey, please don't do that! This room is already a thread on Discord - trying to embed threads inside it will not work. The user will just see a regular reply.",
|
||||
"m.mentions": { "user_ids": [event.sender]},
|
||||
|
|
@ -82,7 +82,7 @@ async function bridgeThread(event) {
|
|||
*/
|
||||
async function handleForums(event) {
|
||||
if (event.content.body === "/thread") return false; //Let the help be shown normally
|
||||
|
||||
|
||||
const row = from("channel_room").where({room_id: event.room_id}).select("channel_id").get()
|
||||
/** @type {string}*/ //@ts-ignore the possibility that it's undefined: get() will return back an undefined if it's fed one (so that's undefined-safe), and createThreadWithoutMessage() won't be reached because "undefined" is neither DiscordTypes.ChannelType.GuildMedia nor DiscordTypes.ChannelType.GuildForum, so the guard clause kicks in.
|
||||
let channelID = row?.channel_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue