mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 09:48:26 -04:00
change: show a message when .prune fails due to already running error
This commit is contained in:
@@ -65,23 +65,6 @@ public partial class Administration
|
||||
await progressMsg.DeleteAsync();
|
||||
}
|
||||
|
||||
private async Task SendResult(PruneResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case PruneResult.Success:
|
||||
break;
|
||||
case PruneResult.AlreadyRunning:
|
||||
break;
|
||||
case PruneResult.FeatureLimit:
|
||||
await Response().Pending(strs.feature_limit_reached_owner).SendAsync();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(result), result, null);
|
||||
}
|
||||
}
|
||||
|
||||
// prune x
|
||||
[Cmd]
|
||||
[RequireContext(ContextType.Guild)]
|
||||
@@ -218,5 +201,27 @@ public partial class Administration
|
||||
|
||||
await Response().Confirm(strs.prune_cancelled).SendAsync();
|
||||
}
|
||||
|
||||
|
||||
private async Task SendResult(PruneResult result)
|
||||
{
|
||||
switch (result)
|
||||
{
|
||||
case PruneResult.Success:
|
||||
break;
|
||||
case PruneResult.AlreadyRunning:
|
||||
var msg = await Response().Pending(strs.prune_already_running).SendAsync();
|
||||
msg.DeleteAfter(5);
|
||||
break;
|
||||
case PruneResult.FeatureLimit:
|
||||
var msg2 = await Response().Pending(strs.feature_limit_reached_owner).SendAsync();
|
||||
msg2.DeleteAfter(10);
|
||||
break;
|
||||
default:
|
||||
Log.Error("Unhandled result received in prune: {Result}", result);
|
||||
await Response().Error(strs.error_occured).SendAsync();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -38,6 +38,7 @@
|
||||
"prune_cancelled": "Pruning was cancelled.",
|
||||
"prune_not_found": "No active prune was found on this server.",
|
||||
"prune_progress": "Pruning... {0}/{1} messages deleted.",
|
||||
"prune_already_running": "A prune is already running on this server.",
|
||||
"timeoutdm": "You have been timed out in {0} server.\nReason: {1}",
|
||||
"timedout_user": "User Timed Out",
|
||||
"remove_roles_pl": "have had their roles removed",
|
||||
|
Reference in New Issue
Block a user