mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat(bot): don't query db message context when running commands
This commit is contained in:
parent
7cb3a3ea0f
commit
9848b88d5b
9 changed files with 67 additions and 65 deletions
|
|
@ -28,8 +28,8 @@ public class Context
|
|||
|
||||
private Command? _currentCommand;
|
||||
|
||||
public Context(ILifetimeScope provider, int shardId, Guild? guild, Channel channel, MessageCreateEvent message, int commandParseOffset,
|
||||
PKSystem senderSystem, SystemConfig config, MessageContext messageContext)
|
||||
public Context(ILifetimeScope provider, int shardId, Guild? guild, Channel channel, MessageCreateEvent message,
|
||||
int commandParseOffset, PKSystem senderSystem, SystemConfig config)
|
||||
{
|
||||
Message = (Message)message;
|
||||
ShardId = shardId;
|
||||
|
|
@ -37,7 +37,6 @@ public class Context
|
|||
Channel = channel;
|
||||
System = senderSystem;
|
||||
Config = config;
|
||||
MessageContext = messageContext;
|
||||
Cache = provider.Resolve<IDiscordCache>();
|
||||
Database = provider.Resolve<IDatabase>();
|
||||
Repository = provider.Resolve<ModelRepository>();
|
||||
|
|
@ -61,7 +60,6 @@ public class Context
|
|||
public readonly Guild Guild;
|
||||
public readonly int ShardId;
|
||||
public readonly Cluster Cluster;
|
||||
public readonly MessageContext MessageContext;
|
||||
|
||||
public Task<PermissionSet> BotPermissions => Cache.PermissionsIn(Channel.Id);
|
||||
public Task<PermissionSet> UserPermissions => Cache.PermissionsFor((MessageCreateEvent)Message);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue