@@ -23,7 +23,7 @@ namespace Discord.Commands | |||||
public OverrideTypeReaderAttribute(Type overridenTypeReader) | public OverrideTypeReaderAttribute(Type overridenTypeReader) | ||||
{ | { | ||||
if (!TypeReaderTypeInfo.IsAssignableFrom(overridenTypeReader.GetTypeInfo())) | if (!TypeReaderTypeInfo.IsAssignableFrom(overridenTypeReader.GetTypeInfo())) | ||||
throw new ArgumentException($"{nameof(overridenTypeReader)} must inherit from {nameof(TypeReader)}"); | |||||
throw new ArgumentException($"{nameof(overridenTypeReader)} must inherit from {nameof(TypeReader)}."); | |||||
TypeReader = overridenTypeReader; | TypeReader = overridenTypeReader; | ||||
} | } | ||||
@@ -69,7 +69,7 @@ namespace Discord | |||||
{ | { | ||||
if (TryParse(text, out Emote result)) | if (TryParse(text, out Emote result)) | ||||
return result; | return result; | ||||
throw new ArgumentException(message: "Invalid emote format", paramName: nameof(text)); | |||||
throw new ArgumentException(message: "Invalid emote format.", paramName: nameof(text)); | |||||
} | } | ||||
/// <summary> Tries to parse an <see cref="Emote"/> from its raw format. </summary> | /// <summary> Tries to parse an <see cref="Emote"/> from its raw format. </summary> | ||||
@@ -75,7 +75,7 @@ namespace Discord | |||||
get => _url; | get => _url; | ||||
set | set | ||||
{ | { | ||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI", paramName: nameof(Url)); | |||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI.", paramName: nameof(Url)); | |||||
_url = value; | _url = value; | ||||
} | } | ||||
} | } | ||||
@@ -87,7 +87,7 @@ namespace Discord | |||||
get => _thumbnail?.Url; | get => _thumbnail?.Url; | ||||
set | set | ||||
{ | { | ||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI", paramName: nameof(ThumbnailUrl)); | |||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI.", paramName: nameof(ThumbnailUrl)); | |||||
_thumbnail = new EmbedThumbnail(value, null, null, null); | _thumbnail = new EmbedThumbnail(value, null, null, null); | ||||
} | } | ||||
} | } | ||||
@@ -99,7 +99,7 @@ namespace Discord | |||||
get => _image?.Url; | get => _image?.Url; | ||||
set | set | ||||
{ | { | ||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI", paramName: nameof(ImageUrl)); | |||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI.", paramName: nameof(ImageUrl)); | |||||
_image = new EmbedImage(value, null, null, null); | _image = new EmbedImage(value, null, null, null); | ||||
} | } | ||||
} | } | ||||
@@ -115,7 +115,7 @@ namespace Discord | |||||
get => _fields; | get => _fields; | ||||
set | set | ||||
{ | { | ||||
if (value == null) throw new ArgumentNullException(paramName: nameof(Fields), message: "Cannot set an embed builder's fields collection to null"); | |||||
if (value == null) throw new ArgumentNullException(paramName: nameof(Fields), message: "Cannot set an embed builder's fields collection to null."); | |||||
if (value.Count > MaxFieldCount) throw new ArgumentException(message: $"Field count must be less than or equal to {MaxFieldCount}.", paramName: nameof(Fields)); | if (value.Count > MaxFieldCount) throw new ArgumentException(message: $"Field count must be less than or equal to {MaxFieldCount}.", paramName: nameof(Fields)); | ||||
_fields = value; | _fields = value; | ||||
} | } | ||||
@@ -590,7 +590,7 @@ namespace Discord | |||||
get => _url; | get => _url; | ||||
set | set | ||||
{ | { | ||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI", paramName: nameof(Url)); | |||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI.", paramName: nameof(Url)); | |||||
_url = value; | _url = value; | ||||
} | } | ||||
} | } | ||||
@@ -606,7 +606,7 @@ namespace Discord | |||||
get => _iconUrl; | get => _iconUrl; | ||||
set | set | ||||
{ | { | ||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI", paramName: nameof(IconUrl)); | |||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI.", paramName: nameof(IconUrl)); | |||||
_iconUrl = value; | _iconUrl = value; | ||||
} | } | ||||
} | } | ||||
@@ -708,7 +708,7 @@ namespace Discord | |||||
get => _iconUrl; | get => _iconUrl; | ||||
set | set | ||||
{ | { | ||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI", paramName: nameof(IconUrl)); | |||||
if (!value.IsNullOrUri()) throw new ArgumentException(message: "Url must be a well-formed URI.", paramName: nameof(IconUrl)); | |||||
_iconUrl = value; | _iconUrl = value; | ||||
} | } | ||||
} | } | ||||
@@ -31,7 +31,7 @@ namespace Discord | |||||
case ICategoryChannel _: return Category; | case ICategoryChannel _: return Category; | ||||
case IDMChannel _: return DM; | case IDMChannel _: return DM; | ||||
case IGroupChannel _: return Group; | case IGroupChannel _: return Group; | ||||
default: throw new ArgumentException(message: "Unknown channel type", paramName: nameof(channel)); | |||||
default: throw new ArgumentException(message: "Unknown channel type.", paramName: nameof(channel)); | |||||
} | } | ||||
} | } | ||||
@@ -45,7 +45,7 @@ namespace Discord | |||||
{ | { | ||||
if (TryParseUser(text, out ulong id)) | if (TryParseUser(text, out ulong id)) | ||||
return id; | return id; | ||||
throw new ArgumentException(message: "Invalid mention format", paramName: nameof(text)); | |||||
throw new ArgumentException(message: "Invalid mention format.", paramName: nameof(text)); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// Tries to parse a provided user mention string. | /// Tries to parse a provided user mention string. | ||||
@@ -74,7 +74,7 @@ namespace Discord | |||||
{ | { | ||||
if (TryParseChannel(text, out ulong id)) | if (TryParseChannel(text, out ulong id)) | ||||
return id; | return id; | ||||
throw new ArgumentException(message: "Invalid mention format", paramName: nameof(text)); | |||||
throw new ArgumentException(message: "Invalid mention format.", paramName: nameof(text)); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// Tries to parse a provided channel mention string. | /// Tries to parse a provided channel mention string. | ||||
@@ -100,7 +100,7 @@ namespace Discord | |||||
{ | { | ||||
if (TryParseRole(text, out ulong id)) | if (TryParseRole(text, out ulong id)) | ||||
return id; | return id; | ||||
throw new ArgumentException(message: "Invalid mention format", paramName: nameof(text)); | |||||
throw new ArgumentException(message: "Invalid mention format.", paramName: nameof(text)); | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// Tries to parse a provided role mention string. | /// Tries to parse a provided role mention string. | ||||
@@ -82,7 +82,7 @@ namespace Discord.API | |||||
case TokenType.Bearer: | case TokenType.Bearer: | ||||
return $"Bearer {token}"; | return $"Bearer {token}"; | ||||
default: | default: | ||||
throw new ArgumentException(message: "Unknown OAuth token type", paramName: nameof(tokenType)); | |||||
throw new ArgumentException(message: "Unknown OAuth token type.", paramName: nameof(tokenType)); | |||||
} | } | ||||
} | } | ||||
internal virtual void Dispose(bool disposing) | internal virtual void Dispose(bool disposing) | ||||