chore: format with csharpier

This commit is contained in:
sam 2024-10-09 17:35:11 +02:00
parent 2f516dcb73
commit 4f54077c68
59 changed files with 2000 additions and 942 deletions

View file

@ -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; }
}
}
}

View file

@ -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; }
}
}

View file

@ -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);

View file

@ -10,4 +10,4 @@ public class Watchlist
public required ulong ModeratorId { get; set; }
public required string Reason { get; set; }
}
}