Merge branch 'Tetracyl-master'

This commit is contained in:
Essem 2021-11-21 23:27:15 -06:00
commit 8942d8a409
No known key found for this signature in database
GPG Key ID: 7D497397CC3A2A8C
1 changed files with 9 additions and 1 deletions

View File

@ -74,13 +74,21 @@ 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: [{
color: 16711680,
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) {