2020-12-22 12:15:26 +00:00
|
|
|
using Myriad.Types;
|
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
namespace Myriad.Cache;
|
|
|
|
|
|
|
|
public interface IDiscordCache
|
2020-12-22 12:15:26 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
public ValueTask SaveOwnUser(ulong userId);
|
|
|
|
public ValueTask SaveGuild(Guild guild);
|
|
|
|
public ValueTask SaveChannel(Channel channel);
|
|
|
|
public ValueTask SaveUser(User user);
|
|
|
|
public ValueTask SaveSelfMember(ulong guildId, GuildMemberPartial member);
|
|
|
|
public ValueTask SaveRole(ulong guildId, Role role);
|
|
|
|
public ValueTask SaveDmChannelStub(ulong channelId);
|
2020-12-22 12:15:26 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public ValueTask RemoveGuild(ulong guildId);
|
|
|
|
public ValueTask RemoveChannel(ulong channelId);
|
|
|
|
public ValueTask RemoveUser(ulong userId);
|
|
|
|
public ValueTask RemoveRole(ulong guildId, ulong roleId);
|
2020-12-22 12:15:26 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public Task<ulong> GetOwnUser();
|
|
|
|
public Task<Guild?> TryGetGuild(ulong guildId);
|
|
|
|
public Task<Channel?> TryGetChannel(ulong channelId);
|
|
|
|
public Task<Channel?> TryGetDmChannel(ulong userId);
|
|
|
|
public Task<User?> TryGetUser(ulong userId);
|
|
|
|
public Task<GuildMemberPartial?> TryGetSelfMember(ulong guildId);
|
|
|
|
public Task<Role?> TryGetRole(ulong roleId);
|
2020-12-22 12:15:26 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
public IAsyncEnumerable<Guild> GetAllGuilds();
|
|
|
|
public Task<IEnumerable<Channel>> GetGuildChannels(ulong guildId);
|
2020-12-22 12:15:26 +00:00
|
|
|
}
|