tweaked imagecommand

This commit is contained in:
murm 2023-03-16 21:19:39 -04:00
parent 079c171065
commit 304f147676

View file

@ -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
});
}