Disforget/Program.cs

30 lines
737 B
C#

using Disforget;
string channelArg;
if (args.Length > 0)
{
channelArg = args[0];
}
else
{
Console.Write($"Enter {(Utils.Data.Type.ToLower() == "dm" ? "channel" : "guild")} ID...\n> ");
channelArg = Console.ReadLine()!;
}
if (!ulong.TryParse(channelArg, out ulong channel))
{
Console.WriteLine($"Invalid channel argument: {args[0]}. Expected a positive integer...");
Environment.Exit(-1);
return;
}
Console.WriteLine("Starting...");
Search search = new(channel);
var messages = await search.Perform();
Delete deletion = new(messages);
int reps = await deletion.StartDeletion();
Console.WriteLine($"\n\nDeleted {messages.Count} messages.\nResent {reps} deletion requests.");