2021-08-27 15:03:47 +00:00
|
|
|
using System.Collections.Generic;
|
2020-12-22 12:15:26 +00:00
|
|
|
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);
|
2021-03-18 10:28:11 +00:00
|
|
|
public ValueTask SaveDmChannelStub(ulong channelId);
|
2020-12-22 12:15:26 +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 15:55:13 +00:00
|
|
|
public bool TryGetGuild(ulong guildId, out Guild guild);
|
|
|
|
public bool TryGetChannel(ulong channelId, out Channel channel);
|
2020-12-25 12:19:35 +00:00
|
|
|
public bool TryGetDmChannel(ulong userId, out Channel channel);
|
2020-12-22 15:55:13 +00:00
|
|
|
public bool TryGetUser(ulong userId, out User user);
|
|
|
|
public bool TryGetRole(ulong roleId, out Role role);
|
2020-12-22 12:15:26 +00:00
|
|
|
|
|
|
|
public IAsyncEnumerable<Guild> GetAllGuilds();
|
2020-12-22 15:55:13 +00:00
|
|
|
public IEnumerable<Channel> GetGuildChannels(ulong guildId);
|
2020-12-22 12:15:26 +00:00
|
|
|
}
|
|
|
|
}
|