Пример #1
0
        private async Task OnReactionsClearedAsync(ulong id, Optional <SocketUserMessage> msg)
        {
            using (var db = new LogDatabase())
            {
                var logs = db.Reactions.Where(x => x.MessageId == msg.Value.Id);

                foreach (var log in logs)
                {
                    log.DeletedAt = DateTime.UtcNow;
                }

                db.UpdateRange(logs);
                await db.SaveChangesAsync();
            }
        }
Пример #2
0
        private async Task OnReactionsClearedAsync(Cacheable <IUserMessage, ulong> message, ISocketMessageChannel channel)
        {
            using (var db = new LogDatabase())
            {
                var logs = db.Reactions.Where(x => x.MessageId == message.Id);

                foreach (var log in logs)
                {
                    log.DeletedAt = DateTime.UtcNow;
                }

                db.UpdateRange(logs);
                await db.SaveChangesAsync();
            }
        }