Wycademy/src/Wycademy/Commands/Services/BlacklistService.cs
/// <summary>
/// Adds an ID to a blacklist, if it's not already there.
/// </summary>
/// <param name="id">The ID to add.</param>
/// <param name="category">The category to add the ID to.</param>
Adds an ID to a blacklist, if it's not already there.
Adds an ID to a blacklist if it ' s not already there .
public async Task AddToBlacklist(ulong id, BlacklistType category)
        {
            switch (category)
            {
                case BlacklistType.User:
                    if (!CheckBlacklist(id, BlacklistType.User)) _userBlacklist.Add(id);
                    break;
                case BlacklistType.Guild:
                    if (!CheckBlacklist(id, BlacklistType.Guild)) _guildBlacklist.Add(id);
                    break;
                case BlacklistType.GuildOwner:
                    if (!CheckBlacklist(id, BlacklistType.GuildOwner)) _guildOwnerBlacklist.Add(id);
                    break;
            }
            await SaveAsync();
        }
public async Task AddToBlacklist ( ulong id , BlacklistType category ) { switch ( category ) { case BlacklistType . User : if ( ! CheckBlacklist ( id , BlacklistType . User ) ) _userBlacklist . Add ( id ) ; break ; case BlacklistType . Guild : if ( ! CheckBlacklist ( id , BlacklistType . Guild ) ) _guildBlacklist . Add ( id ) ; break ; case BlacklistType . GuildOwner : if ( ! CheckBlacklist ( id , BlacklistType . GuildOwner ) ) _guildOwnerBlacklist . Add ( id ) ; break ; } await SaveAsync ( ) ; }
Adds an ID to a blacklist, if it's not already there.
Adds an ID to a blacklist if it ' s not already there .
id
ulong
The ID to add.
The ID to add .
category
BlacklistType
The category to add the ID to.
The category to add the ID to .