Return the messages from ImportMessages

This commit is contained in:
RogueException
2015-11-29 03:14:59 -04:00
parent f9e61d89a6
commit 6acd5afdae

View File

@@ -260,7 +260,7 @@ namespace Discord
} }
/// <summary> Deserializes messages from JSON format and imports them into the message cache.</summary> /// <summary> Deserializes messages from JSON format and imports them into the message cache.</summary>
public void ImportMessages(string json) public IEnumerable<Message> ImportMessages(string json)
{ {
if (json == null) throw new ArgumentNullException(nameof(json)); if (json == null) throw new ArgumentNullException(nameof(json));
@@ -278,6 +278,7 @@ namespace Discord
}) })
.ToDictionary(x => x.Id); .ToDictionary(x => x.Id);
_messages.Import(dic); _messages.Import(dic);
return dic.Values;
} }
/// <summary> Serializes the message cache for a given channel to JSON.</summary> /// <summary> Serializes the message cache for a given channel to JSON.</summary>