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;
|
||||
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
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue