ChatClient/ChatClient.cs
/// <summary>
/// Cancels a host for the specified channel.
/// </summary>
/// <param name="channel">The name of the channel to unhost.</param>
/// <param name="channelName">The name of the channel to unhost from; default: sole connected channel.</param>
/// <returns>False if error.</returns>
Cancels a host for the specified channel.
Cancels a host for the specified channel .
public bool UnhostChannel(string? channel, string? channelName = null) {
            if (string.IsNullOrEmpty(channel)) {
                LogLine($"null/empty {nameof(channel)}", LogLevel.Warn);
                return false;
            }
            channelName = GetValidChannelName(channelName);
            if (string.IsNullOrEmpty(channelName)) {
                LogLine($"null/empty {nameof(channelName)}", LogLevel.Error);
                return false;
            }
            if (!SendMessage($"/unhost {channel}")) {
                LogLine($"Failed to unhost channel: {channel}", LogLevel.Error);
                return false;
            }
            LogLine($"Unhosted channel: {channel}", LogLevel.Info);
            return true;
        }
public bool UnhostChannel ( string ? channel , string ? channelName = null ) { if ( string . IsNullOrEmpty ( channel ) ) { LogLine ( $" null/empty  { nameof ( channel ) } " , LogLevel . Warn ) ; return false ; } channelName = GetValidChannelName ( channelName ) ; if ( string . IsNullOrEmpty ( channelName ) ) { LogLine ( $" null/empty  { nameof ( channelName ) } " , LogLevel . Error ) ; return false ; } if ( ! SendMessage ( $" /unhost  { channel } " ) ) { LogLine ( $" Failed to unhost channel:  { channel } " , LogLevel . Error ) ; return false ; } LogLine ( $" Unhosted channel:  { channel } " , LogLevel . Info ) ; return true ; }
Cancels a host for the specified channel.
Cancels a host for the specified channel .
False if error.
False if error .
channel
string?
The name of the channel to unhost.
The name of the channel to unhost .
channelName
string?
The name of the channel to unhost from; default: sole connected channel.
The name of the channel to unhost from ; default : sole connected channel .