示例#1
0
        public async Task TestRaidMonitor(string raidKey)
        {
            var raid = await _softClient.Query(raidKey);

            var embed = await _raidMonitorMessageFactory.CreateRaidMonitorEmbed(raid);

            var message = await ReplyAsync("", false, embed);

            var softResRaidEntity = await _softResEventRepository.FindAsync(raidKey) ?? new SoftResEvent();

            _mapper.Map <RaidModel, SoftResEvent>(raid, softResRaidEntity);
            var raidMonitor = new SoftResRaidMonitor()
            {
                CreatedAt    = DateTime.UtcNow,
                RemoveAt     = DateTime.UtcNow + TimeSpan.FromMinutes(15),
                Id           = message.Id,
                RaidChannel  = await _channelService.AddOrGetChannel(Context),
                SoftResEvent = softResRaidEntity
            };
            await _raidMonitorRepository.PostAsync(raidMonitor);

            await _raidMonitorRepository.SaveAllChangesAsync();
        }
示例#2
0
        public async Task MonitorSoftResRaid(string raidKey, int hoursToMonitor = 5)
        {
            var model = await _softResClient.Query(raidKey);

            await ReplyAsync($"```json\n{JsonConvert.SerializeObject(model, Formatting.Indented)}\n```");
        }