Exemplo n.º 1
0
        public async Task AddMarkovAsync(ulong id, string messageContent)
        {
            var server = await _context.Servers
                         .FindAsync(id);

            if (server == null)
            {
                _context.Add(new Server {
                    Id = id
                });
            }

            _context.Add(new Markov {
                MessageContent = messageContent, ServerId = id
            });
            await _context.SaveChangesAsync();
        }
Exemplo n.º 2
0
        public async Task AddMutedAsync(ulong id, ulong userId)
        {
            var server = await _context.Servers
                         .FindAsync(id);

            if (server == null)
            {
                _context.Add(new Server {
                    Id = id
                });
            }

            _context.Add(new Muted {
                UserId = userId, ServerId = id
            });
            await _context.SaveChangesAsync();
        }
Exemplo n.º 3
0
        public async Task AddAutoRoleAsync(ulong id, ulong roleId)
        {
            var server = await _context.Servers
                         .FindAsync(id);

            if (server == null)
            {
                _context.Add(new Server {
                    Id = id
                });
            }

            _context.Add(new AutoRole {
                RoleId = roleId, ServerId = id
            });
            await _context.SaveChangesAsync();
        }
Exemplo n.º 4
0
        public async Task AddLimitAsync(ulong id, ulong channelId)
        {
            var server = await _context.Servers
                         .FindAsync(id);

            if (server == null)
            {
                _context.Add(new Server {
                    Id = id
                });
            }

            _context.Add(new Limit {
                ChannelId = channelId, ServerId = id
            });
            await _context.SaveChangesAsync();
        }
Exemplo n.º 5
0
        public async Task ModifyGuildPrefix(ulong id, string prefix)
        {
            var server = await _context.Servers
                         .FindAsync(id);

            if (server == null)
            {
                _context.Add(new Server {
                    Id = id, Prefix = prefix
                });
            }
            else
            {
                server.Prefix = prefix;
            }
            await _context.SaveChangesAsync();
        }