feature: Add GetStreams to AudioClient (#1588)

* Added GetStreams

* Change return type

* Change return type on the interface

Co-authored-by: Paulo <pnmanjos@hotmail.com>
This commit is contained in:
Jack Fox
2020-11-08 16:21:51 -05:00
committed by GitHub
parent 10fcde0a32
commit 1e012ac0b8
2 changed files with 12 additions and 2 deletions

View File

@@ -99,6 +99,12 @@ namespace Discord.Audio
_token = token;
await _connection.StartAsync().ConfigureAwait(false);
}
public IReadOnlyDictionary<ulong, AudioInStream> GetStreams()
{
return _streams.ToDictionary(pair => pair.Key, pair => pair.Value.Reader);
}
public async Task StopAsync()
{
await _connection.StopAsync().ConfigureAwait(false);
@@ -379,7 +385,7 @@ namespace Discord.Audio
private async Task RunHeartbeatAsync(int intervalMillis, CancellationToken cancelToken)
{
//TODO: Clean this up when Discord's session patch is live
// TODO: Clean this up when Discord's session patch is live
try
{
await _audioLogger.DebugAsync("Heartbeat Started").ConfigureAwait(false);