tweaked imagecommand
This commit is contained in:
parent
079c171065
commit
304f147676
1 changed files with 6 additions and 6 deletions
|
@ -75,7 +75,7 @@ class ImageCommand extends Command {
|
||||||
|
|
||||||
let status;
|
let status;
|
||||||
if (imageParams.params.type === "image/gif" && this.type === "classic") {
|
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 {
|
try {
|
||||||
|
@ -95,7 +95,9 @@ class ImageCommand extends Command {
|
||||||
throw e;
|
throw e;
|
||||||
} finally {
|
} finally {
|
||||||
try {
|
try {
|
||||||
if (status) await status.delete();
|
if (status) {
|
||||||
|
// TODO: tell status message to self-destruct
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// no-op
|
// no-op
|
||||||
}
|
}
|
||||||
|
@ -104,16 +106,14 @@ class ImageCommand extends Command {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
processMessage(channel) {
|
async processMessage(channel) {
|
||||||
this.client.send
|
this.client.send
|
||||||
const content = {
|
const content = {
|
||||||
body: "Processing... This might take a while",
|
body: "Processing... This might take a while",
|
||||||
msgtype: "m.text",
|
msgtype: "m.text",
|
||||||
};
|
};
|
||||||
this.client.sendEvent(channel, "m.room.message", content, "", (err, res) => {
|
return await this.client.sendEvent(channel, "m.room.message", content, "", (err, res) => {
|
||||||
// console.log(res)
|
|
||||||
logger.log("error", err)
|
logger.log("error", err)
|
||||||
return res
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue