mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-20 00:43:36 +03:00
resolving issues attempt №2
This commit is contained in:
parent
f056ecebc1
commit
81d353a16a
1 changed files with 1 additions and 10 deletions
|
@ -19,18 +19,15 @@ public sealed class ScheduledEventUpdateService : BackgroundService
|
||||||
private readonly IDiscordRestGuildScheduledEventAPI _eventApi;
|
private readonly IDiscordRestGuildScheduledEventAPI _eventApi;
|
||||||
private readonly GuildDataService _guildData;
|
private readonly GuildDataService _guildData;
|
||||||
private readonly ILogger<ScheduledEventUpdateService> _logger;
|
private readonly ILogger<ScheduledEventUpdateService> _logger;
|
||||||
private readonly IDiscordRestUserAPI _userApi;
|
|
||||||
private readonly UtilityService _utility;
|
private readonly UtilityService _utility;
|
||||||
|
|
||||||
public ScheduledEventUpdateService(IDiscordRestChannelAPI channelApi, IDiscordRestGuildScheduledEventAPI eventApi,
|
public ScheduledEventUpdateService(IDiscordRestChannelAPI channelApi, IDiscordRestGuildScheduledEventAPI eventApi,
|
||||||
GuildDataService guildData, ILogger<ScheduledEventUpdateService> logger, IDiscordRestUserAPI userApi,
|
GuildDataService guildData, ILogger<ScheduledEventUpdateService> logger, UtilityService utility)
|
||||||
UtilityService utility)
|
|
||||||
{
|
{
|
||||||
_channelApi = channelApi;
|
_channelApi = channelApi;
|
||||||
_eventApi = eventApi;
|
_eventApi = eventApi;
|
||||||
_guildData = guildData;
|
_guildData = guildData;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_userApi = userApi;
|
|
||||||
_utility = utility;
|
_utility = utility;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,12 +342,6 @@ public sealed class ScheduledEventUpdateService : BackgroundService
|
||||||
private async Task<Result> SendEarlyEventNotificationAsync(
|
private async Task<Result> SendEarlyEventNotificationAsync(
|
||||||
IGuildScheduledEvent scheduledEvent, GuildData data, CancellationToken ct)
|
IGuildScheduledEvent scheduledEvent, GuildData data, CancellationToken ct)
|
||||||
{
|
{
|
||||||
var currentUserResult = await _userApi.GetCurrentUserAsync(ct);
|
|
||||||
if (!currentUserResult.IsDefined(out _))
|
|
||||||
{
|
|
||||||
return Result.FromError(currentUserResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
var contentResult = await _utility.GetEventNotificationMentions(
|
var contentResult = await _utility.GetEventNotificationMentions(
|
||||||
scheduledEvent, data.Settings, ct);
|
scheduledEvent, data.Settings, ct);
|
||||||
if (!contentResult.IsDefined(out var content))
|
if (!contentResult.IsDefined(out var content))
|
||||||
|
|
Loading…
Add table
Reference in a new issue