Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update NetCord to latest #196

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="NetCord" Version="1.0.0-alpha.270" />
<PackageReference Include="NetCord.Hosting" Version="1.0.0-alpha.40" />
<PackageReference Include="NetCord.Hosting.Services" Version="1.0.0-alpha.49" />
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.171" />
<PackageReference Include="NetCord" Version="1.0.0-alpha.338" />
<PackageReference Include="NetCord.Hosting" Version="1.0.0-alpha.338" />
<PackageReference Include="NetCord.Hosting.Services" Version="1.0.0-alpha.338" />
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.338" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 10 additions & 1 deletion src/Lavalink4NET.NetCord/GatewayClientWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ internal sealed class GatewayClientWrapper : GatewayClientWrapperBase, IDiscordC
{
private readonly GatewayClient _client;

private readonly TaskCompletionSource<bool> _ready = new();

public GatewayClientWrapper(GatewayClient client)
{
ArgumentNullException.ThrowIfNull(client);
Expand All @@ -19,6 +21,13 @@ public GatewayClientWrapper(GatewayClient client)

_client.VoiceStateUpdate += HandleVoiceStateUpdateAsync;
_client.VoiceServerUpdate += HandleVoiceServerUpdateAsync;
_client.Ready += HandleReady;
}

private ValueTask HandleReady(ReadyEventArgs arg)
{
_ready.TrySetResult(true);
return default;
}

public void Dispose()
Expand All @@ -31,7 +40,7 @@ public override async ValueTask<ClientInformation> WaitForReadyAsync(Cancellatio
{
cancellationToken.ThrowIfCancellationRequested();

await _client.ReadyAsync
await _ready.Task
.WaitAsync(cancellationToken)
.ConfigureAwait(false);

Expand Down
4 changes: 2 additions & 2 deletions src/Lavalink4NET.NetCord/Lavalink4NET.NetCord.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NetCord" Version="1.0.0-alpha.270" />
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.171" />
<PackageReference Include="NetCord" Version="1.0.0-alpha.338" />
<PackageReference Include="NetCord.Services" Version="1.0.0-alpha.338" />
</ItemGroup>

<ItemGroup>
Expand Down