PluralKit/Myriad/Cache/IDiscordCache.cs
spiral e7f36eb31f
feat: async cache
this breaks logging bot permissions to Sentry.

we haven't had a need to check those recently (permissions issues were because of broken cache), so this is fine for now
this should be re-added in the future though
2021-11-17 20:41:02 -05:00

30 lines
1.1 KiB
C#

using System.Collections.Generic;
using System.Threading.Tasks;
using Myriad.Types;
namespace Myriad.Cache
{
public interface IDiscordCache
{
public ValueTask SaveGuild(Guild guild);
public ValueTask SaveChannel(Channel channel);
public ValueTask SaveUser(User user);
public ValueTask SaveRole(ulong guildId, Role role);
public ValueTask SaveDmChannelStub(ulong channelId);
public ValueTask RemoveGuild(ulong guildId);
public ValueTask RemoveChannel(ulong channelId);
public ValueTask RemoveUser(ulong userId);
public ValueTask RemoveRole(ulong guildId, ulong roleId);
public Task<bool> TryGetGuild(ulong guildId, out Guild guild);
public Task<bool> TryGetChannel(ulong channelId, out Channel channel);
public Task<bool> TryGetDmChannel(ulong userId, out Channel channel);
public Task<bool> TryGetUser(ulong userId, out User user);
public Task<bool> TryGetRole(ulong roleId, out Role role);
public IAsyncEnumerable<Guild> GetAllGuilds();
public Task<IEnumerable<Channel>> GetGuildChannels(ulong guildId);
}
}