Adding argument null check in sendmessage
This commit is contained in:
@@ -1265,7 +1265,14 @@ namespace Discord
|
|||||||
//Chat
|
//Chat
|
||||||
/// <summary> Sends a message to the provided channel. </summary>
|
/// <summary> Sends a message to the provided channel. </summary>
|
||||||
public Task<Message[]> SendMessage(Channel channel, string text)
|
public Task<Message[]> SendMessage(Channel channel, string text)
|
||||||
=> SendMessage(channel.Id, text, new string[0]);
|
{
|
||||||
|
if (channel == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("channel");
|
||||||
|
}
|
||||||
|
|
||||||
|
return SendMessage(channel.Id, text, new string[0]);
|
||||||
|
}
|
||||||
/// <summary> Sends a message to the provided channel. </summary>
|
/// <summary> Sends a message to the provided channel. </summary>
|
||||||
public Task<Message[]> SendMessage(string channelId, string text)
|
public Task<Message[]> SendMessage(string channelId, string text)
|
||||||
=> SendMessage(channelId, text, new string[0]);
|
=> SendMessage(channelId, text, new string[0]);
|
||||||
|
|||||||
Reference in New Issue
Block a user