diff --git a/Commands/MoveCommand.cs b/Commands/MoveCommand.cs index 98f2e5c..b028cee 100644 --- a/Commands/MoveCommand.cs +++ b/Commands/MoveCommand.cs @@ -64,6 +64,17 @@ public class MoveCommand return; } + if (categoryChannel.Children.Count == 50) + { + Logger.Warn("Could not move ticket " + ticket.id.ToString("00000") + " to the category '" + categoryChannel.Name + "', likely because it is full."); + await command.RespondAsync(new DiscordEmbedBuilder + { + Color = DiscordColor.Red, + Description = "Error: Unable to move ticket to that category, is it full?" + }, true); + return; + } + try { await command.Channel.ModifyAsync(modifiedAttributes => modifiedAttributes.Parent = categoryChannel); @@ -77,6 +88,16 @@ public class MoveCommand }, true); return; } + catch (BadRequestException) + { + Logger.Warn("Could not move ticket " + ticket.id.ToString("00000") + " to the category '" + categoryChannel.Name + "', likely because it is full."); + await command.RespondAsync(new DiscordEmbedBuilder + { + Color = DiscordColor.Red, + Description = "Error: Unable to move ticket to that category, is it full?" + }, true); + return; + } await command.RespondAsync(new DiscordEmbedBuilder {