When sending a message with no content, do not send a null value.
Resolves an issue where the ratelimiter would panic.
This commit is contained in:
@@ -9,7 +9,6 @@ namespace Discord.API.Rest
|
|||||||
{
|
{
|
||||||
[JsonProperty("content")]
|
[JsonProperty("content")]
|
||||||
public Optional<string> Content { get; }
|
public Optional<string> Content { get; }
|
||||||
|
|
||||||
[JsonProperty("nonce")]
|
[JsonProperty("nonce")]
|
||||||
public Optional<string> Nonce { get; set; }
|
public Optional<string> Nonce { get; set; }
|
||||||
[JsonProperty("tts")]
|
[JsonProperty("tts")]
|
||||||
@@ -20,7 +19,7 @@ namespace Discord.API.Rest
|
|||||||
public CreateMessageParams(string content)
|
public CreateMessageParams(string content)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(content))
|
if (string.IsNullOrEmpty(content))
|
||||||
Content = null;
|
Content = Optional.Create<string>();
|
||||||
else
|
else
|
||||||
Content = content;
|
Content = content;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user