add: Implemented .leaveunkeptservers which will cause the bot to leave all servers unmarked by .keep. Extremely dangerous and irreversible. Meant for use on public bot.

This commit is contained in:
Kwoth
2024-08-26 23:09:33 +00:00
parent 67b186a1a5
commit 9424d4d5f9
5 changed files with 134 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
namespace NadekoBot.Modules.Administration;
public partial class Administration
public partial class Administration
{
[Group]
public partial class CleanupCommands : CleanupModuleBase
@@ -39,5 +39,27 @@ public partial class Administration
await Response().Text("This guild's bot data will be saved.").SendAsync();
}
[Cmd]
[OwnerOnly]
public async Task LeaveUnkeptServers()
{
var keptGuildCount = await _svc.GetKeptGuildCount();
var response = await PromptUserConfirmAsync(new EmbedBuilder()
.WithDescription($"""
Do you want the bot to leave all unkept servers?
There are currently {keptGuildCount} kept servers.
**This is a highly destructive and irreversible action.**
"""));
if (!response)
return;
await _svc.LeaveUnkeptServers();
await ctx.OkAsync();
}
}
}