Skip to content

Commit 3ab8dfd

Browse files
committed
Update ACMClient.cs
1 parent aca9019 commit 3ab8dfd

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

Amino.NET/ACMClient.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Runtime.InteropServices;
99
using System.Text;
1010
using System.Text.Json;
11+
using System.Threading;
1112
using System.Threading.Tasks;
1213

1314
namespace Amino
@@ -101,7 +102,24 @@ public Task create_community(string name, string tagline, byte[] icon, string th
101102

102103
public Task delete_community(string email, string password, string verificationCode)
103104
{
104-
105+
JObject data = new JObject()
106+
{
107+
{ "secret", $"0 {password}" },
108+
{ "validationContext", new JObject() {
109+
{ "data", new JObject() { "code", verificationCode } }
110+
}},
111+
{ "type", 1 },
112+
{ "identity", email },
113+
{ "deviceId", this.Client.deviceID },
114+
{ "timestamp", helpers.GetTimestamp() * 1000 }
115+
};
116+
RestRequest request = new RestRequest($"/g/s-x{CommunityId}/community/delete-request");
117+
request.AddJsonBody(JsonConvert.SerializeObject(data));
118+
request.AddHeader("NDC-MSG-SIG", helpers.generate_signiture(JsonConvert.SerializeObject(data)));
119+
var response = RClient.ExecutePost(request);
120+
if(!response.IsSuccessStatusCode) { throw new Exception(response.Content); }
121+
if(Client.debug) { Trace.WriteLine(response.Content); }
122+
return Task.CompletedTask;
105123
}
106124

107125
}

0 commit comments

Comments
 (0)