chore: format with csharpier
This commit is contained in:
parent
2f516dcb73
commit
4f54077c68
59 changed files with 2000 additions and 942 deletions
|
|
@ -9,18 +9,26 @@ public class Guild
|
|||
[DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
public required ulong Id { get; init; }
|
||||
|
||||
[Column(TypeName = "jsonb")] public ChannelConfig Channels { get; init; } = new();
|
||||
[Column(TypeName = "jsonb")]
|
||||
public ChannelConfig Channels { get; init; } = new();
|
||||
public List<string> BannedSystems { get; init; } = [];
|
||||
public List<ulong> KeyRoles { get; init; } = [];
|
||||
|
||||
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())) return true;
|
||||
if (
|
||||
Channels is { MessageDelete: 0, MessageUpdate: 0, MessageDeleteBulk: 0 }
|
||||
|| Channels.IgnoredChannels.Contains(channelId.ToUlong())
|
||||
|| Channels.IgnoredUsers.Contains(userId.ToUlong())
|
||||
)
|
||||
return true;
|
||||
|
||||
if (Channels.IgnoredUsersPerChannel.TryGetValue(channelId.ToUlong(),
|
||||
out var thisChannelIgnoredUsers))
|
||||
if (
|
||||
Channels.IgnoredUsersPerChannel.TryGetValue(
|
||||
channelId.ToUlong(),
|
||||
out var thisChannelIgnoredUsers
|
||||
)
|
||||
)
|
||||
return thisChannelIgnoredUsers.Contains(userId.ToUlong());
|
||||
|
||||
return false;
|
||||
|
|
@ -56,4 +64,4 @@ public class Guild
|
|||
public ulong MessageDelete { get; set; }
|
||||
public ulong MessageDeleteBulk { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@ public class Invite
|
|||
public required ulong GuildId { get; init; }
|
||||
public required string Code { get; init; }
|
||||
public required string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,16 @@ public class Message
|
|||
public string? Member { get; set; }
|
||||
public string? System { get; set; }
|
||||
|
||||
[Column("username")] public byte[] EncryptedUsername { get; set; } = [];
|
||||
[Column("content")] public byte[] EncryptedContent { get; set; } = [];
|
||||
[Column("metadata")] public byte[]? EncryptedMetadata { get; set; }
|
||||
[Column("username")]
|
||||
public byte[] EncryptedUsername { get; set; } = [];
|
||||
|
||||
[Column("content")]
|
||||
public byte[] EncryptedContent { get; set; } = [];
|
||||
|
||||
[Column("metadata")]
|
||||
public byte[]? EncryptedMetadata { get; set; }
|
||||
|
||||
public int AttachmentSize { get; set; } = 0;
|
||||
}
|
||||
|
||||
public record IgnoredMessage(
|
||||
[property: DatabaseGenerated(DatabaseGeneratedOption.None)]
|
||||
ulong Id);
|
||||
public record IgnoredMessage([property: DatabaseGenerated(DatabaseGeneratedOption.None)] ulong Id);
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ public class Watchlist
|
|||
|
||||
public required ulong ModeratorId { get; set; }
|
||||
public required string Reason { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue