-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
41 lines (37 loc) · 1.36 KB
/
Copy pathProgram.cs
File metadata and controls
41 lines (37 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using PoniLCU;
using System.Text.Json;
using LOLFriendsCleaner;
using static PoniLCU.LeagueClient;
var leagueClient = new LeagueClient(credentials.cmd);
var data = await leagueClient.Request(requestMethod.GET, "/lol-chat/v1/friends");
var friends = JsonSerializer.Deserialize<List<Friend>>(data);
Console.WriteLine($$"""
Are you sure you want to delete all of your friends?
You have {{friends?.Count ?? 0}} friends in game!
Type 1 for yes, 2 for no
""");
var input = int.Parse(Console.ReadLine() ?? "0");
if ((input, friends) is (1, { }))
{
var friendIndex = 0;
foreach (var friend in friends)
{
friendIndex++;
await leagueClient.Request(requestMethod.DELETE, $"/lol-chat/v1/friends/{friend.puuid}");
Console.WriteLine($"Removed {friend.gameName}");
if (friendIndex % 3 is 0)
{
// The client has a rate limit, which might trigger a warning to RiotGames (causing a ban). Avoid this with a delay.
await Task.Delay(1000);
}
}
Console.WriteLine($$"""
Removed All friends!
Please restart your game to make sure that It's not bugged!
""");
}
else
{
Console.WriteLine("Exiting...");
Thread.Sleep(1000);
}