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}`
|
name: `${this.constructor.command}.${type}`
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} 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 === "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.";
|
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;
|
throw e;
|
||||||
|
|
|
@ -10,6 +10,9 @@ class ServerInfoCommand extends Command {
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: this.message.channel.guild.iconURL
|
url: this.message.channel.guild.iconURL
|
||||||
},
|
},
|
||||||
|
image: {
|
||||||
|
url: this.message.channel.guild.bannerURL
|
||||||
|
},
|
||||||
color: 16711680,
|
color: 16711680,
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
|
@ -20,25 +23,24 @@ class ServerInfoCommand extends Command {
|
||||||
name: "👤 **Owner:**",
|
name: "👤 **Owner:**",
|
||||||
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.message.channel.guild.ownerID
|
value: owner ? `${owner.user.username}#${owner.user.discriminator}` : this.message.channel.guild.ownerID
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "🗺 **Region:**",
|
|
||||||
value: this.message.channel.guild.region
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "🗓 **Created on:**",
|
name: "🗓 **Created on:**",
|
||||||
value: `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
value: `<t:${Math.floor(this.message.channel.guild.createdAt / 1000)}:F>`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "👥 **Users:**",
|
name: "👥 **Users:**",
|
||||||
value: this.message.channel.guild.memberCount
|
value: this.message.channel.guild.memberCount,
|
||||||
|
inline: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "💬 **Channels:**",
|
name: "💬 **Channels:**",
|
||||||
value: this.message.channel.guild.channels.size
|
value: this.message.channel.guild.channels.size,
|
||||||
|
inline: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "😃 **Emojis:**",
|
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"];
|
static aliases = ["server"];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ServerInfoCommand;
|
export default ServerInfoCommand;
|
||||||
|
|
|
@ -90,7 +90,7 @@ class ImageConnection {
|
||||||
|
|
||||||
async onClose() {
|
async onClose() {
|
||||||
for (const promise of this.requests.values()) {
|
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();
|
this.requests.clear();
|
||||||
if (!this.disconnected) {
|
if (!this.disconnected) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue