Patch stalling when attempting to remove system messages
This commit is contained in:
parent
3f2fd049fb
commit
ee396a626d
2 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,11 @@ public class Delete
|
||||||
var resp = await _cli.DeleteAsync($"https://discord.com/api/v9/channels/{msg.ChannelId}/messages/{msg.Id}");
|
var resp = await _cli.DeleteAsync($"https://discord.com/api/v9/channels/{msg.ChannelId}/messages/{msg.Id}");
|
||||||
|
|
||||||
Console.Write($"\x1b[2K\rRequest {cnt}/{_messages.Count} Status: {resp.StatusCode} [{(resp.IsSuccessStatusCode ? "OK" : "REPEATING")}] ... ({_messages.Count - cnt} left)");
|
Console.Write($"\x1b[2K\rRequest {cnt}/{_messages.Count} Status: {resp.StatusCode} [{(resp.IsSuccessStatusCode ? "OK" : "REPEATING")}] ... ({_messages.Count - cnt} left)");
|
||||||
|
if ((int)resp.StatusCode / 100 == 4)
|
||||||
|
{
|
||||||
|
cnt++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!resp.IsSuccessStatusCode)
|
if (!resp.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
await Task.Delay(30000);
|
await Task.Delay(30000);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<PublishSingleFile>true</PublishSingleFile>
|
<PublishSingleFile>true</PublishSingleFile>
|
||||||
|
|
Loading…
Reference in a new issue