예제 #1
0
        async Task RunAsync(DiscordClient client, BotChannelList.Item channelItem, CancellationToken cancellationToken = default)
        {
            if (!(client.GetChannel(channelItem.Id) is IMessageChannel channel))
            {
                _logger.LogWarning($"Could not find channel {channelItem.Id} to roll in.");
                return;
            }

            await Task.WhenAll(RunRollAsync(client, channel, cancellationToken), RunDailyKakeraAsync(channel, cancellationToken));
        }
예제 #2
0
 public Roller(BotChannelList.Item item, CancellationToken cancellationToken)
 {
     Cancellation = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
     CurrentItem  = item;
 }