Exemplo n.º 1
0
        public async Task CreateAlert(string name, int time, int?day, string text, List <ulong> roles, ulong channel, ulong user)
        {
            var timeInfo = await _timeZoneService.GetTime(user, day, time);

            var alert = new Alert
            {
                Name          = name,
                Description   = text,
                Roles         = roles.ConcatenateULongs(),
                Time          = timeInfo.Item2,
                Day           = timeInfo.Item1,
                ChannelId     = channel,
                DiscordUserId = user
            };

            _plogDbContext.Add(alert);
            await _plogDbContext.SaveChangesAsync();
        }