diff --git a/src/Discord.Net/WebSocket/DiscordSocketClient.cs b/src/Discord.Net/WebSocket/DiscordSocketClient.cs index a77110c66..fec02d465 100644 --- a/src/Discord.Net/WebSocket/DiscordSocketClient.cs +++ b/src/Discord.Net/WebSocket/DiscordSocketClient.cs @@ -792,7 +792,7 @@ namespace Discord.WebSocket var guild = DataStore.GetGuild(data.GuildId.Value); if (guild != null) { - guild.AddChannel(data, DataStore); + channel = guild.AddChannel(data, DataStore); if (!guild.IsSynced) { diff --git a/src/Discord.Net/WebSocket/Entities/Guilds/SocketGuild.cs b/src/Discord.Net/WebSocket/Entities/Guilds/SocketGuild.cs index ea0eb07a9..75f8fded2 100644 --- a/src/Discord.Net/WebSocket/Entities/Guilds/SocketGuild.cs +++ b/src/Discord.Net/WebSocket/Entities/Guilds/SocketGuild.cs @@ -148,11 +148,12 @@ namespace Discord.WebSocket public override Task GetChannelAsync(ulong id) => Task.FromResult(GetChannel(id)); public override Task> GetChannelsAsync() => Task.FromResult>(Channels); - public void AddChannel(ChannelModel model, DataStore dataStore, ConcurrentHashSet channels = null) + public ISocketGuildChannel AddChannel(ChannelModel model, DataStore dataStore, ConcurrentHashSet channels = null) { var channel = ToChannel(model); (channels ?? _channels).TryAdd(model.Id); dataStore.AddChannel(channel); + return channel; } public ISocketGuildChannel GetChannel(ulong id) {