mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Refactor data stores, merging the Store classes
This commit is contained in:
parent
1ab84b54dd
commit
6a73b3bdd6
21 changed files with 540 additions and 338 deletions
|
|
@ -9,14 +9,14 @@ namespace PluralKit.Bot.Commands
|
|||
public class ModCommands
|
||||
{
|
||||
private LogChannelService _logChannels;
|
||||
private MessageStore _messages;
|
||||
private IDataStore _data;
|
||||
|
||||
private EmbedService _embeds;
|
||||
|
||||
public ModCommands(LogChannelService logChannels, MessageStore messages, EmbedService embeds)
|
||||
public ModCommands(LogChannelService logChannels, IDataStore data, EmbedService embeds)
|
||||
{
|
||||
_logChannels = logChannels;
|
||||
_messages = messages;
|
||||
_data = data;
|
||||
_embeds = embeds;
|
||||
}
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ namespace PluralKit.Bot.Commands
|
|||
messageId = ulong.Parse(match.Groups[1].Value);
|
||||
else throw new PKSyntaxError($"Could not parse `{word}` as a message ID or link.");
|
||||
|
||||
var message = await _messages.Get(messageId);
|
||||
var message = await _data.GetMessage(messageId);
|
||||
if (message == null) throw Errors.MessageNotFound(messageId);
|
||||
|
||||
await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue