fix embed queue
This commit is contained in:
parent
ded4f4db26
commit
8d4a7b1729
13 changed files with 188 additions and 32 deletions
|
|
@ -10,7 +10,9 @@ public class ChannelCacheService
|
|||
private readonly ConcurrentDictionary<Snowflake, IChannel> _channels = new();
|
||||
private readonly ConcurrentDictionary<Snowflake, HashSet<Snowflake>> _guildChannels = new();
|
||||
|
||||
public void AddChannel(IChannel channel, Snowflake? guildId = null)
|
||||
public int Size => _channels.Count;
|
||||
|
||||
public void Set(IChannel channel, Snowflake? guildId = null)
|
||||
{
|
||||
_channels[channel.ID] = channel;
|
||||
if (guildId == null)
|
||||
|
|
@ -29,9 +31,9 @@ public class ChannelCacheService
|
|||
});
|
||||
}
|
||||
|
||||
public bool GetChannel(Snowflake id, [NotNullWhen(true)] out IChannel? channel) => _channels.TryGetValue(id, out channel);
|
||||
public bool TryGet(Snowflake id, [NotNullWhen(true)] out IChannel? channel) => _channels.TryGetValue(id, out channel);
|
||||
|
||||
public void RemoveChannel(Snowflake? guildId, Snowflake id, out IChannel? channel)
|
||||
public void Remove(Snowflake? guildId, Snowflake id, out IChannel? channel)
|
||||
{
|
||||
_channels.Remove(id, out channel);
|
||||
if (guildId == null) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue