Skip to content

Commit

Permalink
update NetCord to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Pannoniae committed Dec 23, 2024
1 parent fc7e926 commit 7d24a47
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
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
12 changes: 10 additions & 2 deletions 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,12 @@ 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 +39,7 @@ public override async ValueTask<ClientInformation> WaitForReadyAsync(Cancellatio
{
cancellationToken.ThrowIfCancellationRequested();

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

Expand All @@ -46,4 +54,4 @@ protected override bool TryGetGuild(ulong guildId, [MaybeNullWhen(false)] out Gu
{
return _client.Cache.Guilds.TryGetValue(guildId, out guild);
}
}
}
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

0 comments on commit 7d24a47

Please sign in to comment.