Adjusted serverinfo, added message on premature image request end
This commit is contained in:
parent
64462f2202
commit
72efad0928
3 changed files with 12 additions and 9 deletions
|
@ -107,6 +107,7 @@ class ImageCommand extends Command {
|
|||
name: `${this.constructor.command}.${type}`
|
||||
};
|
||||
} catch (e) {
|
||||
if (e === "Request ended prematurely due to a closed connection") return "This image job couldn't be completed because the server it was running on went down. Try running your command again.";
|
||||
if (e === "Job timed out" || e === "Timeout") return "The image is taking too long to process (>=15 minutes), so the job was cancelled. Try using a smaller image.";
|
||||
if (e.toString().includes("Not connected to image server") || 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;
|
||||
|
|
|
@ -10,6 +10,9 @@ class ServerInfoCommand extends Command {
|
|||
thumbnail: {
|
||||
url: this.message.channel.guild.iconURL
|
||||
},
|
||||
image: {
|
||||
url: this.message.channel.guild.bannerURL
|
||||
},
|
||||
color: 16711680,
|
||||
fields: [
|
||||
{
|
||||
|
@ -20,25 +23,24 @@ class ServerInfoCommand extends Command {
|
|||
name: "👤 **Owner:**",
|
||||
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.message.channel.guild.ownerID
|
||||
},
|
||||
{
|
||||
name: "🗺 **Region:**",
|
||||
value: this.message.channel.guild.region
|
||||
},
|
||||
{
|
||||
name: "🗓 **Created on:**",
|
||||
value: `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
||||
},
|
||||
{
|
||||
name: "👥 **Users:**",
|
||||
value: this.message.channel.guild.memberCount
|
||||
value: this.message.channel.guild.memberCount,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "💬 **Channels:**",
|
||||
value: this.message.channel.guild.channels.size
|
||||
value: this.message.channel.guild.channels.size,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: "😃 **Emojis:**",
|
||||
value: this.message.channel.guild.emojis.length
|
||||
value: this.message.channel.guild.emojis.length,
|
||||
inline: true
|
||||
}
|
||||
]
|
||||
}]
|
||||
|
@ -49,4 +51,4 @@ class ServerInfoCommand extends Command {
|
|||
static aliases = ["server"];
|
||||
}
|
||||
|
||||
export default ServerInfoCommand;
|
||||
export default ServerInfoCommand;
|
||||
|
|
|
@ -90,7 +90,7 @@ class ImageConnection {
|
|||
|
||||
async onClose() {
|
||||
for (const promise of this.requests.values()) {
|
||||
promise.reject(new Error("Request ended prematurely due to a closed connection"));
|
||||
promise.reject("Request ended prematurely due to a closed connection");
|
||||
}
|
||||
this.requests.clear();
|
||||
if (!this.disconnected) {
|
||||
|
|
Loading…
Reference in a new issue