Skip to content
This repository was archived by the owner on Apr 30, 2024. It is now read-only.

Commit 5b4be04

Browse files
authored
Merge pull request #610 from UWPCommunity/rewrite/main
Alpha update
2 parents dfc577d + 8508825 commit 5b4be04

File tree

87 files changed

+1241
-152
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1241
-152
lines changed

Quarrel.sln

Lines changed: 143 additions & 0 deletions
Large diffs are not rendered by default.

samples/Quarrel.Samples.RichPresence/MainPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private async void Connect(object sender, RoutedEventArgs e)
4343
private async void SetActivity(object sender, RoutedEventArgs e)
4444
{
4545
Activity activity = new Activity(ActivityName.Text);
46-
bool success = await _connection.SetActivity(activity);
46+
await _connection.SetActivity(activity);
4747
}
4848
}
4949
}

src/API/Discord.API.Status/Discord.API.Status.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<Configurations>Debug;Insider;Alpha;Release</Configurations>
6+
<GenerateDocumentationFile>false</GenerateDocumentationFile>
67
</PropertyGroup>
78

89
<ItemGroup>

src/API/Discord.API.Status/Models/Datum.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
using System.Text.Json.Serialization;
44

5+
// JSON models don't need to respect standard nullable rules.
6+
#pragma warning disable CS8618
7+
58
namespace Discord.API.Status.Models
69
{
710
/// <summary>

src/API/Discord.API.Status/Models/Summary.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22

33
using System.Text.Json.Serialization;
44

5+
// JSON models don't need to respect standard nullable rules.
6+
#pragma warning disable CS8618
7+
58
namespace Discord.API.Status.Models
69
{
10+
/// <summary>
11+
/// A summary of a data set.
12+
/// </summary>
713
public partial class Summary
814
{
15+
/// <summary>
16+
/// The sum of the data.
17+
/// </summary>
918
[JsonPropertyName("sum")]
1019
public double Sum { get; set; }
1120

21+
/// <summary>
22+
/// The mean of the data.
23+
/// </summary>
1224
[JsonPropertyName("mean")]
1325
public double Mean { get; set; }
1426
}

src/API/Discord.API/Discord.API.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
<PackageReference Include="Refit" Version="6.3.2" />
1111
</ItemGroup>
1212

13+
<ItemGroup>
14+
<ProjectReference Include="..\..\Libs\Quarrel.Common\Quarrel.Common.csproj" />
15+
</ItemGroup>
16+
1317
</Project>

src/API/Discord.API/Gateways/Gateway.Requests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Quarrel © 2022
22

33
using Discord.API.Gateways.Models;
4+
using Discord.API.Models.Enums.Users;
45
using System;
56
using System.Threading.Tasks;
67

@@ -43,19 +44,19 @@ public void SubscribeToGuildAsync(ulong[] channelIds)
4344
throw new NotImplementedException();
4445
}
4546

46-
public async Task UpdateStatusAsync(string status, int? idleSince, bool isAfk)
47+
public async Task UpdateStatusAsync(UserStatus status, int? idleSince = null, bool isAfk = false)
4748
{
4849
var payload = new StatusUpdate()
4950
{
50-
Status = status,
51+
Status = status.GetStringValue(),
5152
IdleSince = idleSince,
5253
IsAFK = isAfk,
5354
};
5455

5556
await UpdateStatusAsync(payload);
5657
}
5758

58-
public async Task UpdateStatusAsync(StatusUpdate payload)
59+
private async Task UpdateStatusAsync(StatusUpdate payload)
5960
{
6061
var frame = new SocketFrame<StatusUpdate>()
6162
{

src/API/Discord.API/Models/Enums/Messages/ComponentType.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Quarrel © 2022
22

3-
using System;
4-
using System.Collections.Generic;
5-
using System.Text;
6-
73
namespace Discord.API.Models.Enums.Messages
84
{
95
public enum ComponentType

src/API/Discord.API/Models/Enums/Messages/MessageFlags.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
// Quarrel © 2022
22

3-
using System;
4-
using System.Collections.Generic;
5-
using System.Text;
6-
73
namespace Discord.API.Models.Enums.Messages
84
{
95
public enum MessageFlags

src/API/Discord.API/Models/Enums/Users/UserStatus.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Quarrel © 2022
22

3+
using Quarrel.Attributes;
4+
35
namespace Discord.API.Models.Enums.Users
46
{
57
/// <summary>
@@ -10,31 +12,37 @@ public enum UserStatus
1012
/// <summary>
1113
/// The user is offline.
1214
/// </summary>
15+
[StringValue("offline")]
1316
Offline,
1417

1518
/// <summary>
1619
/// The user is online.
1720
/// </summary>
21+
[StringValue("online")]
1822
Online,
1923

2024
/// <summary>
2125
/// The user is idle.
2226
/// </summary>
27+
[StringValue("idle")]
2328
Idle,
2429

2530
/// <summary>
2631
/// The user is AFK.
2732
/// </summary>
33+
[StringValue("afk")]
2834
AFK,
2935

3036
/// <summary>
3137
/// The user is on do not disturb.
3238
/// </summary>
39+
[StringValue("dnd")]
3340
DoNotDisturb,
3441

3542
/// <summary>
3643
/// The user is marked offline.
3744
/// </summary>
45+
[StringValue("invisible")]
3846
Invisible,
3947
}
4048
}

0 commit comments

Comments
 (0)