1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-19 16:33:36 +03:00

Resolve failing checks

This commit is contained in:
Octol1ttle 2023-09-30 20:29:21 +05:00
parent 1b7ae55ede
commit 2def27dde5
Signed by: Octol1ttle
GPG key ID: B77C34313AEE1FFF

View file

@ -4,7 +4,6 @@ using System.Text.Json.Nodes;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Octobot.Data;
using Remora.Discord.API.Abstractions.Rest;
using Remora.Rest.Core;
namespace Octobot.Services;
@ -15,14 +14,12 @@ namespace Octobot.Services;
public sealed class GuildDataService : IHostedService
{
private readonly ConcurrentDictionary<Snowflake, GuildData> _datas = new();
private readonly IDiscordRestGuildAPI _guildApi;
private readonly ILogger<GuildDataService> _logger;
// https://github.com/dotnet/aspnetcore/issues/39139
public GuildDataService(
IHostApplicationLifetime lifetime, IDiscordRestGuildAPI guildApi, ILogger<GuildDataService> logger)
IHostApplicationLifetime lifetime, ILogger<GuildDataService> logger)
{
_guildApi = guildApi;
_logger = logger;
lifetime.ApplicationStopping.Register(ApplicationStopping);
}
@ -141,11 +138,6 @@ public sealed class GuildDataService : IHostedService
return (await GetData(guildId, ct)).Settings;
}
public async Task<MemberData> GetMemberData(Snowflake guildId, Snowflake userId, CancellationToken ct = default)
{
return (await GetData(guildId, ct)).GetOrCreateMemberData(userId);
}
public ICollection<Snowflake> GetGuildIds()
{
return _datas.Keys;