Allow tags with more than 2000 characters to be displayed in embeds

This commit is contained in:
EarTensifier 2021-11-21 20:10:36 -08:00
parent 514166c79f
commit 49a1d434c7
1 changed files with 8 additions and 1 deletions

View File

@ -74,13 +74,20 @@ class TagsCommand extends Command {
} else {
const getResult = await database.getTag(this.message.channel.guild.id, this.args[0].toLowerCase());
if (!getResult) return "This tag doesn't exist!";
if (getResult.content.length > 2000) {
return {
embeds: [{
"description": getResult.content,
}],
};
}
return getResult.content;
}
}
async setTag(content, name, message, edit = false) {
if ((!content || content.length === 0) && message.attachments.length === 0) return "You need to provide the content of the tag!";
if (content && content.length >= 2000) return "Your tag content is too long!";
if (content && content.length > 4096) return "Your tag content is too long!";
if (message.attachments.length !== 0 && content) {
await database[edit ? "editTag" : "setTag"](name, { content: `${content} ${message.attachments[0].url}`, author: message.author.id }, message.channel.guild);
} else if (message.attachments.length !== 0) {