diff --git a/classes/imageCommand.js b/classes/imageCommand.js index a73f0f1..02afeba 100644 --- a/classes/imageCommand.js +++ b/classes/imageCommand.js @@ -75,7 +75,7 @@ class ImageCommand extends Command { let status; if (imageParams.params.type === "image/gif" && this.type === "classic") { - status = await this.processMessage(this.message.room_id ?? await this.client.rest.channels.get(this.message.room_id)); + status = await this.processMessage(this.message.room_id); } try { @@ -95,7 +95,9 @@ class ImageCommand extends Command { throw e; } finally { try { - if (status) await status.delete(); + if (status) { + // TODO: tell status message to self-destruct + } } catch { // no-op } @@ -104,16 +106,14 @@ class ImageCommand extends Command { } - processMessage(channel) { + async processMessage(channel) { this.client.send const content = { body: "Processing... This might take a while", msgtype: "m.text", }; - this.client.sendEvent(channel, "m.room.message", content, "", (err, res) => { - // console.log(res) + return await this.client.sendEvent(channel, "m.room.message", content, "", (err, res) => { logger.log("error", err) - return res }); }