mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-12 16:50:10 +00:00
refactor: cache own user ID in IDiscordCache
- remove Cluster.User - remove Cluster.Application (it was only being used as an alternative to Cluster.User for some reason) - move Bot.PermissionsIn to DiscordCacheExtensions
This commit is contained in:
parent
24ac0725af
commit
7a5ba8246e
17 changed files with 61 additions and 40 deletions
|
|
@ -87,7 +87,7 @@ namespace PluralKit.Bot
|
|||
var missingEmojiPermissions = false;
|
||||
foreach (var channel in await _rest.GetGuildChannels(guild.Id))
|
||||
{
|
||||
var botPermissions = await _bot.PermissionsIn(channel.Id);
|
||||
var botPermissions = await _cache.PermissionsIn(channel.Id);
|
||||
var webhookPermissions = await _cache.EveryonePermissions(channel);
|
||||
var userPermissions = PermissionExtensions.PermissionsFor(guild, channel, ctx.Author.Id, senderGuildUser);
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ namespace PluralKit.Bot
|
|||
if (!await ctx.CheckPermissionsInGuildChannel(channel, PermissionSet.ViewChannel))
|
||||
throw new PKError(error);
|
||||
|
||||
var botPermissions = await _bot.PermissionsIn(channel.Id);
|
||||
var botPermissions = await _cache.PermissionsIn(channel.Id);
|
||||
var webhookPermissions = await _cache.EveryonePermissions(channel);
|
||||
|
||||
// We use a bitfield so we can set individual permission bits
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue