mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
refactor(bot): remove saving own user ID from ready event, rely on ID in config
This commit is contained in:
parent
aeb6411b6c
commit
9303dbb91e
17 changed files with 51 additions and 69 deletions
|
|
@ -10,8 +10,6 @@ public static class DiscordCacheExtensions
|
|||
{
|
||||
switch (evt)
|
||||
{
|
||||
case ReadyEvent ready:
|
||||
return cache.SaveOwnUser(ready.User.Id);
|
||||
case GuildCreateEvent gc:
|
||||
return cache.SaveGuildCreate(gc);
|
||||
case GuildUpdateEvent gu:
|
||||
|
|
@ -108,7 +106,7 @@ public static class DiscordCacheExtensions
|
|||
|
||||
if (channel.GuildId != null)
|
||||
{
|
||||
var userId = await cache.GetOwnUser();
|
||||
var userId = cache.GetOwnUser();
|
||||
var member = await cache.TryGetSelfMember(channel.GuildId.Value);
|
||||
return await cache.PermissionsFor(channelId, userId, member);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue