attempt to support THREAD_CREATE but it explodes

This commit is contained in:
Cadence Ember
2023-08-21 08:07:05 +12:00
parent 08d3f3d804
commit d666c0aedb
4 changed files with 38 additions and 5 deletions

View File

@@ -101,7 +101,18 @@ module.exports = {
}
},
/**
/**
* @param {import("./discord-client")} client
* @param {import("discord-api-types/v10").APIChannel} thread
*/
async onThreadCreate(client, thread) {
console.log(thread)
const parentRoomID = db.prepare("SELECT room_id FROM channel_room WHERE channel_id = ?").get(thread.parent_id)
if (!parentRoomID) return // Not interested in a thread if we aren't interested in its wider channel
await createRoom.syncRoom(thread.id)
},
/**
* @param {import("./discord-client")} client
* @param {import("discord-api-types/v10").GatewayChannelUpdateDispatchData} channelOrThread
* @param {boolean} isThread