Rename promise to make more sense
This commit is contained in:
@@ -46,7 +46,7 @@ namespace Discord
|
|||||||
(audioMode & AudioMode.Incoming) == 0,
|
(audioMode & AudioMode.Incoming) == 0,
|
||||||
(audioMode & AudioMode.Outgoing) == 0).ConfigureAwait(false);
|
(audioMode & AudioMode.Outgoing) == 0).ConfigureAwait(false);
|
||||||
|
|
||||||
await Guild.AudioPromise.ConfigureAwait(false);
|
await Guild.AudioConnectPromise.ConfigureAwait(false);
|
||||||
return Guild.AudioClient;
|
return Guild.AudioClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Discord
|
|||||||
internal override bool IsAttached => true;
|
internal override bool IsAttached => true;
|
||||||
|
|
||||||
private readonly SemaphoreSlim _audioLock;
|
private readonly SemaphoreSlim _audioLock;
|
||||||
private TaskCompletionSource<bool> _syncPromise, _downloaderPromise, _audioPromise;
|
private TaskCompletionSource<bool> _syncPromise, _downloaderPromise, _audioConnectPromise;
|
||||||
private ConcurrentHashSet<ulong> _channels;
|
private ConcurrentHashSet<ulong> _channels;
|
||||||
private ConcurrentDictionary<ulong, SocketGuildUser> _members;
|
private ConcurrentDictionary<ulong, SocketGuildUser> _members;
|
||||||
private ConcurrentDictionary<ulong, VoiceState> _voiceStates;
|
private ConcurrentDictionary<ulong, VoiceState> _voiceStates;
|
||||||
@@ -39,7 +39,7 @@ namespace Discord
|
|||||||
public bool IsSynced => _syncPromise.Task.IsCompleted;
|
public bool IsSynced => _syncPromise.Task.IsCompleted;
|
||||||
public Task SyncPromise => _syncPromise.Task;
|
public Task SyncPromise => _syncPromise.Task;
|
||||||
public Task DownloaderPromise => _downloaderPromise.Task;
|
public Task DownloaderPromise => _downloaderPromise.Task;
|
||||||
public Task AudioPromise => _audioPromise.Task;
|
public Task AudioConnectPromise => _audioConnectPromise.Task;
|
||||||
|
|
||||||
public new DiscordSocketClient Discord => base.Discord as DiscordSocketClient;
|
public new DiscordSocketClient Discord => base.Discord as DiscordSocketClient;
|
||||||
public SocketGuildUser CurrentUser => GetUser(Discord.CurrentUser.Id);
|
public SocketGuildUser CurrentUser => GetUser(Discord.CurrentUser.Id);
|
||||||
@@ -308,7 +308,7 @@ namespace Discord
|
|||||||
_audioLock.Release();
|
_audioLock.Release();
|
||||||
}
|
}
|
||||||
await audioClient.ConnectAsync(url, CurrentUser.Id, voiceState.VoiceSessionId, token).ConfigureAwait(false);
|
await audioClient.ConnectAsync(url, CurrentUser.Id, voiceState.VoiceSessionId, token).ConfigureAwait(false);
|
||||||
_audioPromise.TrySetResult(true);
|
_audioConnectPromise.TrySetResult(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SocketGuild Clone() => MemberwiseClone() as SocketGuild;
|
public SocketGuild Clone() => MemberwiseClone() as SocketGuild;
|
||||||
|
|||||||
Reference in New Issue
Block a user