Print d->m errors when there is no room

This commit is contained in:
Cadence Ember
2026-02-04 12:56:52 +13:00
parent c01e347e7b
commit aa7222c4ed
2 changed files with 14 additions and 5 deletions
+4 -2
View File
@@ -51,13 +51,15 @@ module.exports = {
* @param {import("cloudstorm").IGatewayMessage} gatewayMessage
*/
async onError(client, e, gatewayMessage) {
if (gatewayMessage.t === "TYPING_START") return
matrixEventDispatcher.printError(gatewayMessage.t, "Discord", e, gatewayMessage)
const channelID = gatewayMessage.d["channel_id"]
if (!channelID) return
const roomID = select("channel_room", "room_id", {channel_id: channelID}).pluck().get()
if (!roomID) return
if (gatewayMessage.t === "TYPING_START") return
await matrixEventDispatcher.sendError(roomID, "Discord", gatewayMessage.t, e, gatewayMessage)
},