Пример #1
0
 protected async Task UpdateStatsInternalAsync(object stats)
 {
     string json    = JsonConvert.SerializeObject(stats, _statSettings);
     var    content = new StringContent(json, Encoding.UTF8, "application/json");
     await HttpClient.PostAsync($"{DblApi.BaseUrl}{DblApi.GetStatsEndpoint(CurrentUserId)}", content);
 }
Пример #2
0
 /// <summary>
 /// Asynchronously retrieves the stats of a bot specified by its unique identifier (nullable).
 /// </summary>
 /// <param name="id">The unique identifier of the bot you wish to retrieve stats for.</param>
 /// <returns>A generic <see cref="IDblBotStats"/> object.</returns>
 public async Task <IDblBotStats> GetBotStatsAsync(ulong id)
 => await GetAsync <DblBotStats>(DblApi.GetStatsEndpoint(id));