Improved error detection when moving a ticket to a different category
This commit is contained in:
parent
3feaf50b59
commit
f0e48cc2ab
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue