ChatClient/ChatClient.cs
/// <summary>
/// Adds the specified user as a VIP.
/// </summary>
/// <param name="username">The name of the user.</param>
/// <param name="channelName">The name of the channel; default: sole connected channel.</param>
/// <returns>False if error.</returns>
Adds the specified user as a VIP.
Adds the specified user as a VIP .
public bool VIPUser(string? username, string? channelName = null) {
            if (string.IsNullOrEmpty(username)) {
                LogLine($"null/empty {nameof(username)}", LogLevel.Warn);
                return false;
            }
            channelName = GetValidChannelName(channelName);
            if (string.IsNullOrEmpty(channelName)) {
                LogLine($"null/empty {nameof(channelName)}", LogLevel.Error);
                return false;
            }
            if (!SendMessage($"/vip {username}")) {
                LogLine($"Failed to VIP user: {username}", LogLevel.Error);
                return false;
            }
            LogLine($"VIPed user: {username}", LogLevel.Info);
            return true;
        }
public bool VIPUser ( string ? username , string ? channelName = null ) { if ( string . IsNullOrEmpty ( username ) ) { LogLine ( $" null/empty  { nameof ( username ) } " , LogLevel . Warn ) ; return false ; } channelName = GetValidChannelName ( channelName ) ; if ( string . IsNullOrEmpty ( channelName ) ) { LogLine ( $" null/empty  { nameof ( channelName ) } " , LogLevel . Error ) ; return false ; } if ( ! SendMessage ( $" /vip  { username } " ) ) { LogLine ( $" Failed to VIP user:  { username } " , LogLevel . Error ) ; return false ; } LogLine ( $" VIPed user:  { username } " , LogLevel . Info ) ; return true ; }
Adds the specified user as a VIP.
Adds the specified user as a VIP .
False if error.
False if error .
username
string?
The name of the user.
The name of the user .
channelName
string?
The name of the channel; default: sole connected channel.
The name of the channel ; default : sole connected channel .