2 using System.Collections.Generic;
14 public override bool Valid => Address != null && Port.HasValue && Port != 0 && UseSsl.HasValue && (PasswordType.HasValue ^ Password == null);
19 public string? Address {
get;
set; }
24 public ushort? Port {
get;
set; }
29 public string? Nickname {
get;
set; }
34 public bool? UseSsl {
get;
set; }
44 public string? Password {
get;
set; }
57 if (connectionString == null)
58 throw new ArgumentNullException(nameof(connectionString));
59 var splits = connectionString.Split(
';');
63 if (splits.Length < 2)
66 if (UInt16.TryParse(splits[1], out var port))
69 if (splits.Length < 3)
74 if (splits.Length < 4)
77 if (Int32.TryParse(splits[3], out var intSsl))
78 UseSsl = Convert.ToBoolean(intSsl);
80 if (splits.Length < 5)
88 PasswordType = passwordType;
94 if (splits.Length < 6)
97 var rest =
new List<string>(splits);
98 rest.RemoveRange(0, 5);
99 Password = String.Join(
";", rest);
105 var sb =
new StringBuilder();
113 sb.Append(Convert.ToInt32(UseSsl.Value));
114 if (PasswordType.HasValue)
117 sb.Append((
int)PasswordType);
122 return sb.ToString();
Use server authentication
IrcConnectionStringBuilder(string connectionString)
Construct a DiscordConnectionStringBuilder from a connectionString
Helper for building ChatBot.ConnectionStrings
IrcConnectionStringBuilder()
Construct an IrcConnectionStringBuilder
IrcPasswordType
Represents the type of a password for a ChatProvider.Irc
ChatConnectionStringBuilder for ChatProvider.Irc
override string ToString()
Gets the ChatBot.ConnectionString associated with the ChatConnectionStringBuilder ...