Skip to content

Commit

Permalink
Added new property on Player to get the Connected channel easier, cha…
Browse files Browse the repository at this point in the history
…nged setter modifier for Player#GuildID to private
  • Loading branch information
DevYukine committed Jun 27, 2018
1 parent 4466f49 commit 06645f0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Lavalink.NET/Player/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Player
/// <summary>
/// The GuildID of this player.
/// </summary>
public ulong GuildID { get; internal set; }
public ulong GuildID { get; private set; }

/// <summary>
/// The current Status od this player.
Expand All @@ -39,6 +39,11 @@ public class Player
/// </summary>
public bool Connected { get; private set; } = false;

/// <summary>
/// The Channel ID which this Player is currently connected to, if this player isn't connected this is null.
/// </summary>
public ulong? ChannelID { get; private set; } = null;

/// <summary>
/// The position of the Player from the current playing song, this is -1 when there is no Song playing.
/// </summary>
Expand Down Expand Up @@ -88,6 +93,8 @@ public async Task JoinAsync(ulong channelID, bool mute = false, bool deaf = fals
{
await _client.SendAsync(new DiscordOP4Packet(GuildID, channelID, mute, deaf));

ChannelID = channelID;

Connected = true;
}

Expand All @@ -99,6 +106,8 @@ public async Task LeaveAsync()
{
await _client.SendAsync(new DiscordOP4Packet(GuildID, null, false, false));

ChannelID = null;

Connected = false;
}

Expand Down

0 comments on commit 06645f0

Please sign in to comment.