feat: shard status update, delete old messages when they expire
This commit is contained in:
parent
8e030acaf3
commit
32732d74d0
9 changed files with 302 additions and 17 deletions
|
|
@ -18,22 +18,25 @@ public class Guild
|
|||
public bool IsSystemBanned(PluralkitApiService.PkSystem system) =>
|
||||
BannedSystems.Contains(system.Id) || BannedSystems.Contains(system.Uuid.ToString());
|
||||
|
||||
public bool IsMessageIgnored(Snowflake channelId, Snowflake userId)
|
||||
public bool IsMessageIgnored(Snowflake channelId, Snowflake? userId)
|
||||
{
|
||||
if (
|
||||
Channels is { MessageDelete: 0, MessageUpdate: 0, MessageDeleteBulk: 0 }
|
||||
|| Channels.IgnoredChannels.Contains(channelId.ToUlong())
|
||||
|| Channels.IgnoredUsers.Contains(userId.ToUlong())
|
||||
|| (userId != null && Channels.IgnoredUsers.Contains(userId.Value.ToUlong()))
|
||||
)
|
||||
return true;
|
||||
|
||||
if (userId == null)
|
||||
return false;
|
||||
|
||||
if (
|
||||
Channels.IgnoredUsersPerChannel.TryGetValue(
|
||||
channelId.ToUlong(),
|
||||
out var thisChannelIgnoredUsers
|
||||
)
|
||||
)
|
||||
return thisChannelIgnoredUsers.Contains(userId.ToUlong());
|
||||
return thisChannelIgnoredUsers.Contains(userId.Value.ToUlong());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue