Exemple #1
0
        public static async Task DeleteInvite(ulong teamId, ulong userId)
        {
            using var DbContext = new NamikoDbContext();
            var invite = DbContext.Invites.Where(x => x.TeamId == teamId && x.UserId == userId).FirstOrDefault();

            DbContext.Remove(invite);
            await DbContext.SaveChangesAsync();
        }
Exemple #2
0
        public static async Task DeleteServer(ulong GuildId)
        {
            using var db = new NamikoDbContext();
            var server = db.Servers.Where(x => x.GuildId == GuildId).FirstOrDefault();

            if (server != null)
            {
                db.Remove(server);
                await db.SaveChangesAsync();
            }
        }
Exemple #3
0
        public static async Task DeleteDisabledCommand(ulong GuildId, string name, DisabledCommandType type)
        {
            using var db = new NamikoDbContext();
            var command = await db.DisabledCommands.Where(x => x.GuildId == GuildId && x.Name.Equals(name) && x.Type == type).FirstOrDefaultAsync();

            if (command != null)
            {
                db.Remove(command);
                await db.SaveChangesAsync();
            }
        }
        public static async Task DeleteBlacklistedChannel(ulong channelId)
        {
            using NamikoDbContext db = new NamikoDbContext();
            var ch = db.BlacklistedChannels.Where(x => x.ChannelId == channelId).FirstOrDefault();

            if (ch != null)
            {
                db.Remove(ch);
                BlacklistedChannelIds.Remove(ch.ChannelId);
                await db.SaveChangesAsync();
            }
        }
Exemple #5
0
 public static async Task Delete(SpecialChannel ch)
 {
     using var db = new NamikoDbContext();
     db.Remove(ch);
     await db.SaveChangesAsync();
 }