Wycademy/src/Wycademy/Commands/Services/BlacklistService.cs
/// <summary>
/// Removes an item from the specified blacklist.
/// </summary>
/// <param name="id">The ID to remove.</param>
/// <param name="category">The blacklist to remove it from.</param>
/// <returns>Whether or not the operation was successful.</returns>
Removes an item from the specified blacklist.
Removes an item from the specified blacklist .
public async Task<bool> RemoveFromBlacklist(ulong id, BlacklistType category)
        {
            List<ulong> blacklistToCheck = null;
            switch (category)
            {
                case BlacklistType.User:
                    blacklistToCheck = _userBlacklist;
                    break;
                case BlacklistType.Guild:
                    blacklistToCheck = _guildBlacklist;
                    break;
                case BlacklistType.GuildOwner:
                    blacklistToCheck = _guildOwnerBlacklist;
                    break;
            }
            var success = blacklistToCheck.Remove(id);
            await SaveAsync();
            return success;
        }
public async Task < bool > RemoveFromBlacklist ( ulong id , BlacklistType category ) { List < ulong > blacklistToCheck = null ; switch ( category ) { case BlacklistType . User : blacklistToCheck = _userBlacklist ; break ; case BlacklistType . Guild : blacklistToCheck = _guildBlacklist ; break ; case BlacklistType . GuildOwner : blacklistToCheck = _guildOwnerBlacklist ; break ; } var success = blacklistToCheck . Remove ( id ) ; await SaveAsync ( ) ; return success ; }
Removes an item from the specified blacklist.
Removes an item from the specified blacklist .
// Category always has to be one of the 3 blacklist types, so we don't need to worry about blacklistToCheck being null.
Whether or not the operation was successful.
Whether or not the operation was successful .
id
ulong
The ID to remove.
The ID to remove .
category
BlacklistType
The blacklist to remove it from.
The blacklist to remove it from .