Made GetX methods more consistent
This commit is contained in:
@@ -51,6 +51,8 @@ namespace Discord
|
||||
public Channel GetChannel(string id)
|
||||
{
|
||||
if (id == null) throw new ArgumentNullException(nameof(id));
|
||||
CheckReady();
|
||||
|
||||
return _channels[id];
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,13 @@ namespace Discord
|
||||
private readonly Messages _messages;
|
||||
|
||||
/// <summary> Returns the message with the specified id, or null if none was found. </summary>
|
||||
public Message GetMessage(string id) => _messages[id];
|
||||
public Message GetMessage(string id)
|
||||
{
|
||||
if (id == null) throw new ArgumentNullException(nameof(id));
|
||||
CheckReady();
|
||||
|
||||
return _messages[id];
|
||||
}
|
||||
|
||||
/// <summary> Sends a message to the provided channel. To include a mention, see the Mention static helper class. </summary>
|
||||
public Task<Message> SendMessage(Channel channel, string text)
|
||||
|
||||
@@ -62,7 +62,13 @@ namespace Discord
|
||||
private readonly Servers _servers;
|
||||
|
||||
/// <summary> Returns the server with the specified id, or null if none was found. </summary>
|
||||
public Server GetServer(string id) => _servers[id];
|
||||
public Server GetServer(string id)
|
||||
{
|
||||
if (id == null) throw new ArgumentNullException(nameof(id));
|
||||
CheckReady();
|
||||
|
||||
return _servers[id];
|
||||
}
|
||||
|
||||
/// <summary> Returns all servers with the specified name. </summary>
|
||||
/// <remarks> Search is case-insensitive. </remarks>
|
||||
|
||||
Reference in New Issue
Block a user