Skip to content

Commit 0bd1bbd

Browse files
committed
Added more functions
[ + ] Added Client.get_blog_info(string) [ + ] Added Client.get_wiki_info(string) [ + ] Added Client.get_message_info(string,string)
1 parent 6e0f281 commit 0bd1bbd

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

Amino.NET/Client.cs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,6 +2425,59 @@ public Task send_sticker(string chatId, string stickerId)
24252425
return Task.CompletedTask;
24262426
}
24272427

2428+
/// <summary>
2429+
/// Allows you to get information about a blog post
2430+
/// </summary>
2431+
/// <param name="blogId"></param>
2432+
/// <returns></returns>
2433+
/// <exception cref="Exception"></exception>
2434+
public Objects.Blog get_blog_info(string blogId)
2435+
{
2436+
RestClient client = new RestClient(helpers.BaseUrl);
2437+
RestRequest request = new RestRequest($"/g/s/blog/{blogId}");
2438+
request.AddHeaders(headers);
2439+
var response = client.ExecuteGet(request);
2440+
if((int)response.StatusCode != 200) { throw new Exception(response.Content); }
2441+
if(debug) { Trace.WriteLine(response.Content); }
2442+
return new Objects.Blog(JObject.Parse(response.Content));
2443+
}
2444+
2445+
2446+
/// <summary>
2447+
/// Allows you to get information about a wiki post
2448+
/// </summary>
2449+
/// <param name="wikiId"></param>
2450+
/// <returns></returns>
2451+
/// <exception cref="Exception"></exception>
2452+
public Objects.Wiki get_wiki_info(string wikiId)
2453+
{
2454+
RestClient client = new RestClient(helpers.BaseUrl);
2455+
RestRequest request = new RestRequest($"/g/s/item/{wikiId}");
2456+
request.AddHeaders(headers);
2457+
var response = client.ExecuteGet(request);
2458+
if((int)response.StatusCode != 200) { throw new Exception(response.Content); }
2459+
if(debug) { Trace.WriteLine(response.Content); }
2460+
return new Objects.Wiki(JObject.Parse(response.Content));
2461+
}
2462+
2463+
/// <summary>
2464+
/// Allows you to get information about a message in a chat
2465+
/// </summary>
2466+
/// <param name="chatId"></param>
2467+
/// <param name="messageId"></param>
2468+
/// <returns></returns>
2469+
/// <exception cref="Exception"></exception>
2470+
public Objects.Message get_message_info(string chatId, string messageId)
2471+
{
2472+
RestClient client = new RestClient(helpers.BaseUrl);
2473+
RestRequest request = new RestRequest($"/g/s/chat/thread/{chatId}/message/{messageId}");
2474+
request.AddHeaders(headers);
2475+
var response = client.ExecuteGet(request);
2476+
if((int)response.StatusCode != 200) { throw new Exception(response.Content); }
2477+
if(debug) { Trace.WriteLine(response.Content); }
2478+
return new Objects.Message(JObject.Parse(response.Content));
2479+
}
2480+
24282481

24292482
/// <summary>
24302483
/// Sets the SubClient of the Client, not for development use

0 commit comments

Comments
 (0)