Fix some permission checks, fix avatar URLs

This commit is contained in:
Essem 2022-09-23 23:50:59 -05:00
parent 888f2f8b4a
commit 49a60bba96
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
11 changed files with 22 additions and 19 deletions

View file

@ -92,8 +92,11 @@ class ImageCommand extends Command {
if (e === "No available servers") return "I can't seem to contact the image servers, they might be down or still trying to start up. Please wait a little bit.";
throw e;
} finally {
const statusChannel = status.channel ?? await this.client.rest.channels.get(status.channelID);
if (status && (statusChannel.messages ? statusChannel.messages.has(status.id) : await this.client.getMessage(statusChannel.id, status.id).catch(() => undefined))) await status.delete();
try {
if (status) await status.delete();
} catch {
// no-op
}
runningCommands.delete(this.author.id);
}