Made the requested changes

This commit is contained in:
Auxe
2016-09-05 19:32:58 -05:00
parent 169b09aadd
commit 4919c8f591
2 changed files with 3 additions and 2 deletions

View File

@@ -793,7 +793,7 @@ namespace Discord.WebSocket
if (guild != null)
{
guild.AddChannel(data, DataStore);
channel = DataStore.GetChannel(data.Id);
channel = guild.AddChannel(data, DataStore);
if (!guild.IsSynced)
{

View File

@@ -148,11 +148,12 @@ namespace Discord.WebSocket
public override Task<IGuildChannel> GetChannelAsync(ulong id) => Task.FromResult<IGuildChannel>(GetChannel(id));
public override Task<IReadOnlyCollection<IGuildChannel>> GetChannelsAsync() => Task.FromResult<IReadOnlyCollection<IGuildChannel>>(Channels);
public void AddChannel(ChannelModel model, DataStore dataStore, ConcurrentHashSet<ulong> channels = null)
public ISocketGuildChannel AddChannel(ChannelModel model, DataStore dataStore, ConcurrentHashSet<ulong> channels = null)
{
var channel = ToChannel(model);
(channels ?? _channels).TryAdd(model.Id);
dataStore.AddChannel(channel);
return channel;
}
public ISocketGuildChannel GetChannel(ulong id)
{