mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-16 11:02:44 -04:00
Add a tag limit
This commit is contained in:
@@ -97,6 +97,12 @@ public class AddImageTagsCommand : ICommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
image.TagList = image.TagList.Concat(tags).Distinct().ToList();
|
image.TagList = image.TagList.Concat(tags).Distinct().ToList();
|
||||||
|
if (image.TagList.Count > 50)
|
||||||
|
{
|
||||||
|
await botInstance.SendChatMessageAsync($"{user.FormatUsername()}, {id} has a shitload of tags already!",
|
||||||
|
true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
await db.SaveChangesAsync(ctx);
|
await db.SaveChangesAsync(ctx);
|
||||||
await botInstance.SendChatMessageAsync(
|
await botInstance.SendChatMessageAsync(
|
||||||
$"{user.FormatUsername()}, updated tags for image ID {id} with {image.TagList.Humanize()}", true);
|
$"{user.FormatUsername()}, updated tags for image ID {id} with {image.TagList.Humanize()}", true);
|
||||||
|
|||||||
Reference in New Issue
Block a user