25
25
* THE SOFTWARE.
26
26
*/
27
27
28
- namespace Lavalink4NET . Discord_NET
28
+ namespace Lavalink4NET . DiscordNet
29
29
{
30
30
using System . Threading . Tasks ;
31
31
using Discord ;
@@ -46,6 +46,15 @@ public static class IAudioServiceExtensions
46
46
public static TPlayer GetPlayer < TPlayer > ( this IAudioService audioService , IGuild guild ) where TPlayer : LavalinkPlayer
47
47
=> audioService . GetPlayer < TPlayer > ( guild . Id ) ;
48
48
49
+ /// <summary>
50
+ /// Gets the audio player for the specified <paramref name="guild"/>.
51
+ /// </summary>
52
+ /// <param name="audioService">the audio service</param>
53
+ /// <param name="guild">the guild to get the player for</param>
54
+ /// <returns>the player for the guild</returns>
55
+ public static LavalinkPlayer GetPlayer ( this IAudioService audioService , IGuild guild )
56
+ => audioService . GetPlayer ( guild . Id ) ;
57
+
49
58
/// <summary>
50
59
/// Gets a value indicating whether a player is created for the specified <paramref name="guild"/>.
51
60
/// </summary>
@@ -70,5 +79,20 @@ public static bool HasPlayer(this IAudioService audioService, IGuild guild)
70
79
public static Task < TPlayer > JoinAsync < TPlayer > ( this IAudioService audioService , IVoiceChannel voiceChannel ,
71
80
bool selfDeaf = false , bool selfMute = false ) where TPlayer : LavalinkPlayer
72
81
=> audioService . JoinAsync < TPlayer > ( voiceChannel . GuildId , voiceChannel . Id , selfDeaf , selfMute ) ;
82
+
83
+ /// <summary>
84
+ /// Joins the specified <paramref name="audioService"/> asynchronously.
85
+ /// </summary>
86
+ /// <param name="audioService">the audio service</param>
87
+ /// <param name="voiceChannel">the voice channel to join</param>
88
+ /// <param name="selfDeaf">a value indicating whether the bot user should be self deafened</param>
89
+ /// <param name="selfMute">a value indicating whether the bot user should be self muted</param>
90
+ /// <returns>
91
+ /// a task that represents the asynchronous operation
92
+ /// <para>the audio player</para>
93
+ /// </returns>
94
+ public static Task JoinAsync ( this IAudioService audioService , IVoiceChannel voiceChannel ,
95
+ bool selfDeaf = false , bool selfMute = false )
96
+ => audioService . JoinAsync ( voiceChannel . GuildId , voiceChannel . Id , selfDeaf , selfMute ) ;
73
97
}
74
98
}
0 commit comments