mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 21:44:47 +00:00
More nix stuff
This commit is contained in:
1 parent
8b124bc670
commit
f8c85d666d
16 files changed
+449
-170
No files matched your search
@@ -89,7 +89,7 @@ public partial class User
|
||||
[Column("email", TypeName = "character varying")]
|
||||
public string? Email { get; set; }
|
||||
|
||||
[Column("flags")]
|
||||
[Column("flags", TypeName = "character varying")]
|
||||
public ulong Flags { get; set; }
|
||||
|
||||
[Column("public_flags")]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Text.Json.Serialization;
|
||||
using Spacebar.Models.Generic;
|
||||
|
||||
namespace Spacebar.Models.Gateway;
|
||||
|
||||
public class GuildSyncResponse {
|
||||
[JsonPropertyName("id")]
|
||||
public string GuildId { get; set; }
|
||||
|
||||
[JsonPropertyName("presences")]
|
||||
public List<PresenceResponse> Presences { get; set; }
|
||||
|
||||
[JsonPropertyName("members")]
|
||||
public List<Member> Members { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Text.Json.Serialization;
|
||||
using Spacebar.Models.Generic;
|
||||
|
||||
namespace Spacebar.Models.Gateway;
|
||||
|
||||
public class PresenceResponse {
|
||||
[JsonPropertyName("user")]
|
||||
public required PartialUser User { get; set; }
|
||||
|
||||
[JsonPropertyName("guild_id"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? GuildId { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public string Status { get; set; } = "unknown";
|
||||
|
||||
// TODO
|
||||
[JsonPropertyName("activities")]
|
||||
public List<JsonObject> Activities { get; set; }
|
||||
|
||||
// TODO
|
||||
[JsonPropertyName("hidden_activities")]
|
||||
public List<JsonObject> HiddenActivities { get; set; }
|
||||
|
||||
[JsonPropertyName("client_status")]
|
||||
public ClientStatuses ClientStatus { get; set; }
|
||||
|
||||
[JsonPropertyName("has_played_game")]
|
||||
public bool? HasPlayedGame { get; set; }
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public class ClientStatuses {
|
||||
[JsonPropertyName("desktop"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Desktop { get; set; }
|
||||
|
||||
[JsonPropertyName("mobile"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Mobile { get; set; }
|
||||
|
||||
[JsonPropertyName("web"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Web { get; set; }
|
||||
|
||||
[JsonPropertyName("embedded"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Embedded { get; set; }
|
||||
|
||||
[JsonPropertyName("vr"), JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Vr { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Spacebar.Models.Generic\Spacebar.Models.Generic.csproj" Condition="'$(ContinuousIntegrationBuild)'!='true'"/>
|
||||
<PackageReference Include="Spacebar.Models.Generic" Version="*-preview*" Condition="'$(ContinuousIntegrationBuild)'=='true'"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1 @@
|
||||
[]
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Spacebar.Models.Generic;
|
||||
|
||||
[DebuggerDisplay("{User.Id} ({User.Username}#{User.Discriminator})")]
|
||||
public class Member {
|
||||
[JsonPropertyName("user")]
|
||||
public required PartialUser User { get; set; }
|
||||
|
||||
[JsonPropertyName("nick")]
|
||||
public string? Nick { get; set; }
|
||||
|
||||
[JsonPropertyName("avatar")]
|
||||
public string? Avatar { get; set; }
|
||||
|
||||
[JsonPropertyName("avatar_decoration_data")]
|
||||
public object? AvatarDecorationData { get; set; }
|
||||
|
||||
[JsonPropertyName("collectibles")]
|
||||
public object? Collectibles { get; set; }
|
||||
|
||||
[JsonPropertyName("display_name_styles")]
|
||||
public object? DisplayNameStyles { get; set; }
|
||||
|
||||
[JsonPropertyName("banner")]
|
||||
public string? Banner { get; set; }
|
||||
|
||||
[JsonPropertyName("bio")]
|
||||
public string? Bio { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Diagnostics;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Spacebar.Models.Generic;
|
||||
|
||||
[DebuggerDisplay("{Id} ({Username}#{Discriminator})")]
|
||||
public class PartialUser {
|
||||
[JsonPropertyName("id")]
|
||||
public required string Id { get; set; }
|
||||
|
||||
[JsonPropertyName("username")]
|
||||
public string Username { get; set; }
|
||||
|
||||
[JsonPropertyName("discriminator")]
|
||||
public string Discriminator { get; set; }
|
||||
|
||||
[JsonPropertyName("global_name")]
|
||||
public string? GlobalName { get; set; }
|
||||
|
||||
[JsonPropertyName("avatar")]
|
||||
public string? Avatar { get; set; }
|
||||
|
||||
[JsonPropertyName("avatar_decoration_data")]
|
||||
public object? AvatarDecorationData { get; set; }
|
||||
|
||||
[JsonPropertyName("collectibles")]
|
||||
public object? Collectibles { get; set; }
|
||||
|
||||
[JsonPropertyName("display_name_styles")]
|
||||
public object? DisplayNameStyles { get; set; }
|
||||
|
||||
[JsonPropertyName("primary_guild")]
|
||||
public object? PrimaryGuild { get; set; }
|
||||
|
||||
[JsonPropertyName("bot")]
|
||||
public bool? Bot { get; set; }
|
||||
|
||||
[JsonPropertyName("system")]
|
||||
public bool? System { get; set; }
|
||||
|
||||
[JsonPropertyName("banner")]
|
||||
public string? Banner { get; set; }
|
||||
|
||||
[JsonPropertyName("accent_color")]
|
||||
public int? AccentColor { get; set; }
|
||||
|
||||
[JsonPropertyName("public_flags")]
|
||||
public ulong? PublicFlags { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user