-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.RegularExpressions; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using DSharpPlus; | ||
using DSharpPlus.Entities; | ||
using HonzaBotner.Discord.Services.Helpers; | ||
using HonzaBotner.Discord.Services.Options; | ||
using HonzaBotner.Scheduler.Contract; | ||
using HonzaBotner.Services.Contract; | ||
using HonzaBotner.Services.Contract.Dto; | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Extensions.Options; | ||
|
||
namespace HonzaBotner.Discord.Services.Jobs; | ||
|
||
[Cron("0 30 10 * * 1-5")] | ||
public class SuzJobProvider : IJob | ||
{ | ||
private readonly ILogger<SuzJobProvider> _logger; | ||
|
||
private readonly DiscordWrapper _discord; | ||
private readonly ICanteenService _canteenService; | ||
private readonly IGuildProvider _guildProvider; | ||
private readonly CommonCommandOptions _commonOptions; | ||
|
||
public SuzJobProvider( | ||
ILogger<SuzJobProvider> logger, | ||
DiscordWrapper discord, | ||
ICanteenService canteenService, | ||
IGuildProvider guildProvider, | ||
IOptions<CommonCommandOptions> commonOptions) | ||
{ | ||
_logger = logger; | ||
_discord = discord; | ||
_canteenService = canteenService; | ||
_guildProvider = guildProvider; | ||
_commonOptions = commonOptions.Value; | ||
} | ||
|
||
public string Name => "suz-agata"; | ||
|
||
public async Task ExecuteAsync(CancellationToken cancellationToken) | ||
{ | ||
IList<CanteenDto> canteens = await _canteenService.ListCanteensAsync(true, cancellationToken); | ||
|
||
DiscordGuild guild = await _guildProvider.GetCurrentGuildAsync(); | ||
guild.ListActiveThreadsAsync() | ||
_discord.Client.SendMessageAsync() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters