@@ -51,6 +51,8 @@ namespace Discord | |||||
public Channel GetChannel(string id) | public Channel GetChannel(string id) | ||||
{ | { | ||||
if (id == null) throw new ArgumentNullException(nameof(id)); | if (id == null) throw new ArgumentNullException(nameof(id)); | ||||
CheckReady(); | |||||
return _channels[id]; | return _channels[id]; | ||||
} | } | ||||
@@ -80,7 +80,13 @@ namespace Discord | |||||
private readonly Messages _messages; | private readonly Messages _messages; | ||||
/// <summary> Returns the message with the specified id, or null if none was found. </summary> | /// <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> | /// <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) | public Task<Message> SendMessage(Channel channel, string text) | ||||
@@ -62,7 +62,13 @@ namespace Discord | |||||
private readonly Servers _servers; | private readonly Servers _servers; | ||||
/// <summary> Returns the server with the specified id, or null if none was found. </summary> | /// <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> | /// <summary> Returns all servers with the specified name. </summary> | ||||
/// <remarks> Search is case-insensitive. </remarks> | /// <remarks> Search is case-insensitive. </remarks> | ||||